Find Out If There's More Using Google Reader API - google-reader

I understand that when fetching an atom feed, you can specify the number of items to return, and the items will have a continuation field that you can use to start subsequent fetches at a position after the items you've already fetched. The question is: how do you find out if there's anything more to fetch without actually trying to fetch more?

Every atom feed that you get from the Google Reader API will provide a "continuation" token if there's more on the server. If this token is not found in the atom feed, there is no more.

Related

Firebase dynamic links - bulk list

In my application i'm running a cronjob daily in order to get a list of items from a set of providers.
Each item has an image, a title, and a url.
I want to create a Firebase dynamic link out of these parameters and then shorten it.
From the docs of Firebase i saw that it's possible to create the dynamic link offline, and then get the shorten version through a REST API(https://firebase.google.com/docs/dynamic-links/rest).
From what i see i have to send one request for each item. I was wondering if there is a way to get the shorten urls out of a list of items with a single request.
In alternative, other url shortener service suggested for this use case?

Determining search query of guest user

In my app, there's a requirement to track search queries, which individuals to the app. The point here is to track specifically individuals/search_queries, i.e. I want to be able to say:
User 10.20.30.40 (IP is derived from client, ok) came to my website
from Google's search results page of 'hello world' query
Is that even possible?
I investigated the problem a bit. It turned out, that when the user on Google Search result page clicks a link and gets to the underlying page, the referer doesn't contain the search query. Say, for example, I entered a "Hello world" query...
I open google and enter a "Hello world" query;
I see a serach result page with a link to wikipedia on top; I follow it
I enter "document.referrer" in consonle to see:
http://www.google.com.ua/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&ved=0CGkQFjAA&url=http%3A%2F%2Fru.wikipedia.org%2Fwiki%2FHello%2C_world!&ei=HZ0fUIXTIordtAau54GwAQ&usg=AFQjCNHSAHv8NwVNdaxMvh0OhIxs6Zb1rQ&sig2=a8tEGTBNcFWOPykloXj_Xg
There's a &q= param with a blank value, preventing me to figure out the query the user entered.
I believe Google internally uses some of the query params (i.e. ved, ei, usg or sig2) from the URL above to keep track of query used to get to the site, and thus gatehr the statistics about which queries are used mostly to the get to the website. I couldn't find any information regarding how to use them.
In the meantime, Google Analytics would only gather a general statistics, not for individuals. Yet I noticed that there's an ability to use Custom Variables. Is it possible to use them somehow in order to track query the user came with? If so, wouldn't it be a violation of Google Analytics Terms Of Service?
So again: is there a way to know a search query one came to the site with?
This is not possible. Google erases the value of q parameter, so instead of
`?q=search+query`
one always observs.
`?q=`
Though, Google provides another way (the so called convinient one) to know which queries were used to come to your website: Google Analytics.
Also, it's impossible to track user_ip/search_query pair due to Google Analytics ToS.

How to handle non unique item GUIDs/IDs in an RSS feed?

What is the correct response an RSS client should have when it encounters a feed that has multiple items with the same guid/identifier?
Currently in my application, any items that use an existing guid won't be cached or displayed because it believes it already has that item.
In this example feed a lot of items share this id:
tag:blizzard.com,2010-10-22:diablo3:feed:en-us:1
According to w3 when there are duplicate entries in an RSS feed:
Atom Processors MAY choose to display all of them or some subset of them. One typical behavior would be to display only the entry with the latest atom: updated timestamp.
I would go with the spec and display only the entry with the latest updated timestamp. Don't forget to send an email to Blizzard support and have them get their RSS validated - just don't threaten to keep them out of the next raid.
Take care.
I think your app is doing it right. Don't get fancy. If you've already seen an item with that guid you don't present it a second time. You should contact whe webmaster for the feed if possible and alert them to the problem.
Does each item have a unique URL? If so, fall back to using the URL.

How to get more Feed items?

How would I get the next page or more results for a feed?
For example, when I go to Security Now feed page, there is no "next" link of any kind and the url parameter of "page=100" does nothing:
http://leoville.tv/podcasts/sn.xml
I get only 1 page of results of about 20 episodes. However my Google Reader can successfully retrieve episodes that are earlier than that.
Indeed it is true that Google Reader caches the items and it is NOT possible to paginate on RSS2, RSS or Atom feeds (unless they have rel=next link, which none of them seem to have).
However, we can leverage the existing Google Reader infrastructure, with some work, to retrieve a list of, say 200 items!
Given the above podcast url we retrieve the latest 200 episodes by:
Using the ...google.ca/reader/atom/feed prefix instead of the usual view/feed as can be seen in your google reader.
Appending n=200 as the query parameter.
So we have:
http://www.google.ca/reader/atom/feed/http://leoville.tv/podcasts/sn.xml?hl=en&n=200
There is a very insightful reverse-engineered google-reader API project located at http://code.google.com/p/pyrfeed/wiki/GoogleReaderAPI
Google reader caches RSS entries. You can't get any more from the actual feed if they don't allow for it.

How do I sort feeds returned from Google Reader?

When I query Google Reader for the list of subscriptions for a user, it seems to be returned in a fixed order, no matter what the order is as shown at google.com/reader.
(see http://www.google.com/reader/api/0/subscription/list for the list I'm talking about)
Each subscription returns a 'sortid', which Google Reader uses when the user rearranges subscriptions, by sending back a concatenation of all sortids in the new order after rearranging is finished. However, that sortid never changes.
So my question is this: How do I actually get the order the subscriptions are supposed to be in? I've been using http://code.google.com/p/pyrfeed/wiki/GoogleReaderAPI as a reference, but it is lacking in this department, and I haven't found anything anywhere else either.
I've found the answer:
http://www.google.com/reader/api/0/preference/stream/list

Resources