“取消主演” 使用 Google Reader API 的帖子

发布于 2024-07-24 16:40:45 字数 304 浏览 6 评论 0 原文

有谁知道如何使用其非官方 API 删除 Google Reader 中加星标的文章的星标?

我找到了这个,但它不起作用:

http:// /www.niallkennedy.com/blog/2005/12/google-reader-api.html

Python中的pyrfeed模块也没有,我每次都会得到IOError异常。

Does anybody know how to remove stars for articles starred in Google Reader using its unofficial API?

I found this one but it doesn't work:

http://www.niallkennedy.com/blog/2005/12/google-reader-api.html

Neither does the pyrfeed module in Python, I get the IOError exception every time.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

薄情伤 2024-07-31 16:40:45

尝试使用:

r=user%2F[user ID]%2Fstate%2Fcom.google%2Fstarred 

而不是

a=user%2F[user ID]%2Fstate%2Fcom.google%2Fstarred 

调用 edit-tag 时。

Try using:

r=user%2F[user ID]%2Fstate%2Fcom.google%2Fstarred 

instead of

a=user%2F[user ID]%2Fstate%2Fcom.google%2Fstarred 

when invoking edit-tag.

临风闻羌笛 2024-07-31 16:40:45

我没有这方面的Python代码(我有Java),但是你遇到的问题几乎与你使用的语言无关,并且能够在你需要的地方看到一些代码总是好的所有细节。 您只需按照我的要求进行操作,并验证我强调的一些细节,并检查这是否是您的问题。

您可以使用它来删除给定帖子的星号(请注意,如果需要,该服务同时支持多个项目):

        String authToken = getGoogleAuthKey();
    // I use Jsoup for the requests, but you can use anything you
    // like - for jsoup you usually just need to include a jar
    // into your java project
Document doc = Jsoup.connect("http://www.google.com/reader/api/0/edit-tag")
    // this is important for permission - more details on how to get this ahead in the text
    .header("Authorization", _AUTHPARAMS + authToken)
    .data(
             // you don't need the userid, the '-' will suffice
             // "r" means remove. you can also use "a" to add
             // you have lots of other options besides starred. e.g: read
            "r", "user/-/state/com.google/starred",
            "async", "true",
            // the feed, but don't forget the beginning: feed/
            "s", "feed/http://www.gizmodo.com/index.xml",
            // there are 2 id formats, easy to convert - more info ahead in the text
            "i", "tag:google.com,2005:reader/item/1a68fb395bcb6947",
            // another token - this one for allow editing - more details on how to get this ahead in the text
            "T", "//wF1kyvFPIe6JiyITNnMWdA"
    )
    // I also send my API key, but I don't think this is mandatory
    .userAgent("[YOUR_APP_ID_GOES_HERE].apps.googleusercontent.com")
    .timeout(10000)
    // VERY IMPORTANT - don't forget the post! (using get() will not work)
    .post();

您可以在其他问题了解更多实现细节(评论中提到的细节)。

要列出 Feed 中所有已加星标的项目,您可以使用 http:// /www.google.com/reader/api/0/stream/items/idshttp://www.google.com/reader/atom/user/-/state/com.google/starred 。 您可以使用这些 id 调用上述 API 来移除星星。

最后两个更容易使用。 您可以在这些非官方(但结构良好)资源上查看 API 的详细信息:http://www.chrisdadswell.co.uk/android-coding-example-authenticating-clientlogin-google-reader-api/http://code.google.com/p/pyrfeed/wiki/GoogleReaderAPI , http://blog.martindoms.com/2009/10/16 /using-the-google-reader-api-part-2

希望有帮助!

I don't have Python code for this (I have Java), but the problem you're stumbling with is pretty much independent from the language you use, and it is always good to be able to see some code where you need to have all the details. You just need to do the requests I do, and verify some of the details I highlight and check if it might be your problem.

You can use this to remove the star for a given post (note that this service supports more than one item at the same time if you need that):

        String authToken = getGoogleAuthKey();
    // I use Jsoup for the requests, but you can use anything you
    // like - for jsoup you usually just need to include a jar
    // into your java project
Document doc = Jsoup.connect("http://www.google.com/reader/api/0/edit-tag")
    // this is important for permission - more details on how to get this ahead in the text
    .header("Authorization", _AUTHPARAMS + authToken)
    .data(
             // you don't need the userid, the '-' will suffice
             // "r" means remove. you can also use "a" to add
             // you have lots of other options besides starred. e.g: read
            "r", "user/-/state/com.google/starred",
            "async", "true",
            // the feed, but don't forget the beginning: feed/
            "s", "feed/http://www.gizmodo.com/index.xml",
            // there are 2 id formats, easy to convert - more info ahead in the text
            "i", "tag:google.com,2005:reader/item/1a68fb395bcb6947",
            // another token - this one for allow editing - more details on how to get this ahead in the text
            "T", "//wF1kyvFPIe6JiyITNnMWdA"
    )
    // I also send my API key, but I don't think this is mandatory
    .userAgent("[YOUR_APP_ID_GOES_HERE].apps.googleusercontent.com")
    .timeout(10000)
    // VERY IMPORTANT - don't forget the post! (using get() will not work)
    .post();

You can check my answer in this other question for some more implementation details (the ones referred to on the comments).

To list all the starred items inside a feed, you can use http://www.google.com/reader/api/0/stream/items/ids or http://www.google.com/reader/atom/user/-/state/com.google/starred . You can use these ids to call the above mentioned API for removing the star.

These last 2 are a lot easier to use. You can check details on the API on these unoffical (but nicely structured) resources: http://www.chrisdadswell.co.uk/android-coding-example-authenticating-clientlogin-google-reader-api/ , http://code.google.com/p/pyrfeed/wiki/GoogleReaderAPI , http://blog.martindoms.com/2009/10/16/using-the-google-reader-api-part-2

Hope it helps!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文