【问题标题】:Downloading most recent PDF in Issuu在 Issuu 中下载最新的 PDF
【发布时间】:2011-09-15 07:08:25
【问题描述】:

因此,我设法使用 Issuu API 提供了一个 URL,以获取有关我上传的最新 PDF 的大部分信息。问题是我希望能够获得下载该 PDF 的 URL。如何确定下载包含以下给定信息的 PDF 的 URL。

这是我在使用 issuu.documents.list 操作和其他一些参数对结果进行排序和限制后得到的响应等等(我提供了 XML 和 JSON 响应,只是为了好玩和咯咯笑):

XML 响应

<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"/>
                <tag value="sports"/>
                <tag value="lifestyles"/>
                <tag value="opinions"/>
                <tag value="crimson"/>
            </tags>
        </document>
    </result>
</rsp>

JSON 响应

{"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"}}`

此特定文档的下载按钮上的 URL 是 http://document.issuu.com/110914053847-872eaa6e8f844601b0ef763d5332f7eb/original.file?AWSAccessKeyId=AKIAJY7E3JMLFKPAGP7A&amp;Expires=1316073684&amp;Signature=r34xY8RUJYNxTL8X3SSedAWxDxk%3D

AWSAccessKeyIDExpires 属性是什么?我知道签名是计算得到的 MD5 和(不过,我不知道它是否与 Signing Requests 的算法有什么不同)。

这对于我正在开发的显示我公司报纸的最新 PDF 版本的应用程序至关重要。

【问题讨论】:

    标签: xml json pdf download issuu


    【解决方案1】:

    AWSAccessKeyId 是 Amazon Web Service (AWS) 访问密钥。

    它与“API密钥”不同,您可以请求here

    因此,可能对所有文档都使用相同的 AWS 密钥。

    Expires 属性是epoch 日期时间。当您点击 URL 时,您必须在 epoch 中发送当前或未来的日期/时间作为 expires 属性值。可以生成纪元格式here

    签名和Signing Requests一样,你知道有什么工具可以在线生成吗?

    如果有帮助,请告诉我。

    -阿伦·贾恩

    【讨论】:

    • 嗯。现在我看了一下,我提供的链接没有使用相同的签名。使用 API,我将使用 MD5 生成十六进制值。上述链接中的签名不是十六进制的。感谢您指出 AWSAccessKeyId 和 Expires 属性是什么。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2022-06-16
    • 1970-01-01
    • 2013-06-03
    • 1970-01-01
    • 2022-10-19
    • 2014-09-18
    • 2016-07-30
    相关资源
    最近更新 更多