Entries for a tag name coming up empty - zero items

24 views
Skip to first unread message

David Herron

unread,
Nov 14, 2012, 9:08:11 PM11/14/12
to foug...@googlegroups.com
I wrote some code in Node.js to query for entries in a tag name in Reader, and that returns a list of items.  But if I use the same URL in Java, it returns an empty list of items.  The JSON does have the correct meta information but the items array is empty.

Here's my current code in Java to form the URL.  I've tried several different variations and not had any luck.  I do know that tagName has to be URL encoded.

String sUrl = "https://www.google.com/reader/api/0/stream/contents/" + tagName + "?ck="
                + System.currentTimeMillis()  + "&n=40&co=true&c=CKL2t6j30KICSPTQ3f2hhawC&client=exampleCo-exampleApp-1";

Querying on this URL works correctly

        String sUrl = "https://www.google.com/reader/api/0/tag/list?output=json&ck="
                + System.currentTimeMillis()  + "&client=exampleCo-exampleApp-1";
 
It's the same code in both cases.

If it makes any difference I'm using ClientLogin to get an auth code.  The URL is opened this way:

        URLConnection connection = url.openConnection();
        connection.setDoInput(true);
        connection.setRequestProperty("Authorization", "GoogleLogin auth=" + token);

Thank you,

+ David Herron



David Herron

unread,
Nov 16, 2012, 12:49:04 AM11/16/12
to foug...@googlegroups.com
I found a solution to the problem ... FWIW

The problem I had is that the tag names I tried all had spaces in them.  Try a tag/label name that doesn't have spaces and it worked okay.  What I am doing now is this to form the request URL:-

String sUrl = "https://www.google.com/reader/api/0/stream/contents/user/-/label/" + tagName.replace(" ", "%20");

The full source is here:-

https://github.com/robogeek/jBloggerTools/blob/master/src/blogger/Reader.java


Reply all
Reply to author
Forward
0 new messages