开发者

Downloading most recent PDF in Issuu

So I have managed to come up with a URL using the Issuu API to get most all of the information about the latest PDF I have uploaded. The problem is that I want to be able to get the URL to download that PDF. How do I determine the URL to download the PDF with the following given information.

This is the response I get after using the issuu.documents.list action and a few other argument to sort and limit the results and whatnot (I've provided both the XML and JSON responses just for kicks and giggles):

XML Response:

<rsp stat="ok">
    <result totalCount="257" startIndex="0" pageSize="1" more="true">
        <document
            username="thecrimsonwhite"
            name="09.14.11"
            documentId="110914053847-872eaa6e8f844601b0ef763d5332f7eb"
            title="The Crimson White"
            access="public"
            state="A"
            type="007000"
            orgDocType="pdf"
            orgDocName="09.14.11.pdf"
            downloadable="true"
            origin="singleupload"
            pro="F"
            rating="0.0"
            ratingsAllowed="true"
            commentCount="0"
            commentsAllowed="true"
            bookmarkCount="0"
            viewCount="71"
            pageCount="8"
            gfx="7"
            dcla="2|b|8|||810|1476|0|0"
            ls="1"
            ep="1315976400"
            publishDate="2011-09-14T05:00:00.000Z"
            description="The Crimson White is a student-created publication that aims to inform, entertain the University of Alabama and surrounding Tuscaloosa areas.">
            <tags>
                <tag value="news"/>
                <tag value="white"/>
           开发者_Go百科     <tag value="sports"/>
                <tag value="lifestyles"/>
                <tag value="opinions"/>
                <tag value="crimson"/>
            </tags>
        </document>
    </result>
</rsp>

JSON Response:

{"rsp":{"_content":{"result":{"totalCount":257,"startIndex":0,"pageSize":1,"more":true,"_content":[{"document":{"username":"thecrimsonwhite","name":"09.14.11","documentId":"110914053847-872eaa6e8f844601b0ef763d5332f7eb","title":"The Crimson White","access":"public","state":"A","type":"007000","orgDocType":"pdf","orgDocName":"09.14.11.pdf","downloadable":true,"origin":"singleupload","pro":"F","rating":0.00000e+0,"ratingsAllowed":true,"commentCount":0,"commentsAllowed":true,"bookmarkCount":0,"viewCount":71,"pageCount":8,"dcla":"2|b|8|||810|1476|0|0","ep":1315976400,"publishDate":"2011-09-14T05:00:00.000Z","description":"The Crimson White is a student-created publication that aims to inform, entertain the University of Alabama and surrounding Tuscaloosa areas.","tags":["news","white","sports","lifestyles","opinions","crimson"]}}]}},"stat":"ok"}}`

The URL on the download button for this particular document is http://document.issuu.com/110914053847-872eaa6e8f844601b0ef763d5332f7eb/original.file?AWSAccessKeyId=AKIAJY7E3JMLFKPAGP7A&Expires=1316073684&Signature=r34xY8RUJYNxTL8X3SSedAWxDxk%3D

What is the AWSAccessKeyID and Expires attributes? I understand that the signature is a calculated MD5 sum (though, I don't know if it's any different than the alorithm at Signing Requests).

This is critical for an application that I am developing that displays the most recent PDF edition of my company's newspaper.


The AWSAccessKeyId is the Amazon Web Service(AWS) access key.

Its not the same as "API key", which you can request here.

So may be using the same AWS key will work for all documents.

The Expires attribute is epoch date time. When you hit the URL you have to send the current or future date/time in epoch as expires attribute value. You can generate it in epoch format here

Signature is same as given in Signing Requests, do you know any tool to generate it online ?

Let me know if it helps.

-Arun Jain

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜