3

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

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

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

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

4

2 回答 2

1

尝试使用:

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

代替

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

调用编辑标签时。

于 2009-06-19T15:42:17.903 回答
0

我没有这方面的 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();

您可以在其他问题中查看我的回答,了解更多实施细节(评论中提到的那些)。

要列出提要中所有已加星标的项目,您可以使用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 _ _

希望能帮助到你!

于 2011-06-10T00:16:38.493 回答