Google reader public RSS get more than 9 items - url

We need to parse the data from a google reader public rss feed, the problem is that the url parameter n=numerofitemstoretrieve only works up to n=9
For example in our test url:
http://www.google.com/reader/shared/user%2F15926769355350523044%2Flabel%2FPublicas%20RSS?n=2
Retrieves 2 news items
http://www.google.com/reader/shared/user%2F15926769355350523044%2Flabel%2FPublicas%20RSS?n=20
Retrieves only 9 news items
How can we overcome this limitation? Is there another parameter for this case? Or another method?

We found that using this alternative url the n parameter works fine:
https://www.google.com/reader/api/0/stream/contents/feed/http://www.google.com/reader/public/atom/user%2F15926769355350523044%2Flabel%2FPublicas%20RSS?n=20
The only problem is the output format its different this way, so if someone finds a better solution we will grant the response to him/her
It seems the results are cropped only when the url is viewed in the browser...if you get the web contents from code it returns the correct item count...(in contrast using the alternative url the returned contents are right both ways: getting them from code as well as viewing it in the browser)

In Atom format (link in the top right in the two urls in the OP) :
http://www.google.com/reader/public/atom/user%2F15926769355350523044%2Flabel%2FPublicas%20RSS?n=20
The content with /api/ in the URL in the second post is in JSON format, slightly harder to parse than the Atom XML.
https://webapps.stackexchange.com/questions/26567/how-to-raise-google-reader-rss-feed-entry-limit

Related

Jmeter: Dynamic URL encrypted

I'm working on a test plan with Jmeter.
The issue is that I can't retrieve the URL link as he is managed dynamically.
The URL has the following format:
localhost\blablabla?PATHPARAM=qzflh%2FGJHBGDCV%GROPJHVFFFDDFGGCFD%JJYTGVFRTVFGGFF%JUYGBG
I already try to search the value of PATHPARAM in the previous requests to retrieve it using regular expression extractor but I didn't find it.
It seems that this url is generated inside a javascript code but the way to extract it is unknown for me, inside the js code I find the value : var url = actionName + "?" + params ;
Is that any way to catch the content or the var url in Jmeter, else have you any other solution to solve this issue with this dynamic URL.
Many thanks in advance for your help.
I can see 2 possible options:
If you are being redirected to this URL automatically (you might need to play with Redirect Automatically and Follow Redirects boxes in the HTTP Request sampler
If this is the case - you should be able to get it using the following Regular Expression Extractor configuration
If you need to replicate the logic of this param variable calculation - you can attempt to do it using JSR223 PreProcessor which can execute arbitrary JavaScript code

Wikipedia API request sometimes not returning results

I want to make a request to the Wikipedia API to see if a given name has a Wikipedia page.
For example, let's say I make an API request to get the page for Justin Bieber:
source = "https://en.wikipedia.org/w/api.php?action=query&titles=justin%20bieber&prop=revisions&rvprop=content&format=json"
data = open(source).read
json = JSON.parse(data)
Then I get back a JSON response with this info. But why is it not returning any result for some less well known name (even though they have wiki pages?) For example, this brent bolthouse page: https://en.wikipedia.org/wiki/Brent_Bolthouse. If I check the json, there's no indication that it's an actual page..
I basically just want to implement a simple check to see if there's a wiki page that matches the exact name.
Try capitalizing all parts of the name, e.g.:
"brent bolthouse".titleize
=> "Brent Bolthouse"
I suggest this because the titles of Wikipedia's pages on persons always have that format. While your URL with the lowercase name as the query doesn't work, the URL with the capitalized name does.
Ah, I found out MediaWiki is case sensitive for page titles.

Decode url_encoded_fmt_stream_map to valid Url

Im using url_encoded_fmt_stream_map to get a List of Youtube VideoStream "urls".
I want to use these urls to show Youtube videos in my VideoView.
My method pretty much returns a String Array containing Strings like this:
sig=3E0D90E459ADEF9F88553D716B9275930A8AA418.AD0319F9287244E34CCA97F7DE245C0606DD46C5&itag=45&fallback_host=tc.v22.cache5.c.youtube.com&url=http%3A%2F%2Fr4---sn-uigxx50n-8pxl.c.youtube.com%2Fvideoplayback%3Fsparams%3Dcp%252Cid%252Cip%252Cipbits%252Citag%252Cratebypass%252Csource%252Cupn%252Cexpire%26id%3D4e6580527662c67d%26cp%3DU0hVSVlQV19FUENONV9RSkFIOnZ3SkZXb3hfdUdp%26source%3Dyoutube%26fexp%3D919110%252C913564%252C916624%252C932000%252C906383%252C902000%252C919512%252C929903%252C931202%252C900821%252C900823%252C931203%252C931401%252C909419%252C913566%252C908529%252C930807%252C919373%252C930803%252C906836%252C920201%252C929602%252C930101%252C930603%252C900824%252C910223%26ms%3Dau%26mv%3Dm%26mt%3D1364933359%26sver%3D3%26itag%3D45%26key%3Dyt1%26ip%3D178.115.248.80%26newshard%3Dyes%26upn%3DNLMBgU-0oUc%26expire%3D1364959706%26ipbits%3D8%26ratebypass%3Dyes&quality=hd720&type=video%2Fwebm%3B+codecs%3D%22vp8.0%2C+vorbis%22
If you have a close look at it, you can see that this String actually contains valid information. Unfortunately I have no idea how to extract a valid url out of this.
How would I do that?
If I create an URI with the String above and add it to my VideoView, a message "Can't play this video." pops up.
As you probably know, youtube link looks like that:
http://r6---sn-nhpax-ua8l.c.youtube.com/videoplayback?algorithm=throttle-factor&burst=40&cp=U0hVTFlTUV9HUUNONV9RTVVCOkk4ams1XzRlZUpq&cpn=qAthIxAZB16Q6_qB&expire=1367983127&factor=1.25&fexp=927900%2C919357%2C921716%2C916623%2C922911%2C931009%2C932000%2C932004%2C906383%2C904479%2C901208%2C925714%2C929119%2C931202%2C900821%2C900823%2C912518%2C911416%2C930807%2C919373%2C906836%2C926403%2C900824%2C912711%2C929606%2C910075&id=932a6c200e40b791&ip=84.228.249.95&ipbits=8&itag=34&key=yt1&ms=au&mt=1367957244&mv=m&newshard=yes&ratebypass=yes&signature=7E86D1813AE13CEB544CFF3749FBD042FF50EE91.AF7D6D9DCF286D291825630E733B3407683C46C9&source=youtube&sparams=algorithm%2Cburst%2Ccp%2Cfactor%2Cid%2Cip%2Cipbits%2Citag%2Csource%2Cupn%2Cexpire&sver=3&upn=t0jDC5Yk7Go
And as you said, all the parameters we need are shown in your string.
There are 2 important parameters we need to extract from your string: url and signature.
The Link eventually should look like this: url + "&signature=" + sig.
You can take a look at my code, where I extract all the available links out of youtube link. It's wriitten in java for an android app: link
Thank you for your effort.
I solved this problem by sticking to the official YouTube API. Also see this question:
Getting YouTube Video ID including parameters

facebook graph api returns error 2500 when there are commas in the id url

I'm attempting to retrieve the "shares" graph data for a number of pages in JSON format. I suspect that the errors I am encountering stem from the fact that some of the URLs have commas in them, and are being parsed as an attempt to pass multiple ids.
Returns graph data.
https://graph.facebook.com/?ids=http://celebritybabies.people.com/2012/08/23/backstreet-boys-howie-dorough-expecting-second-son/
Returns error 2500 "Cannot specify an empty identifier"
https://graph.facebook.com/?ids=http://www.people.com/people/article/0,,20624518,00.html
Encode the commas, still returns 2500
https://graph.facebook.com/?ids=http://www.people.com.people.article/0%2C%2C20624518%2C00.html
There doesn't seem to a way around it other than to use the normal inspection
http://graph.facebook.com/http://www.people.com/people/article/0,,20624518,00.html
You may have to file a bug at http://developers.facebook.com/bugs though I feel as the answer would most likely be "Status by design".
You could try using FQL instead, querying the link_stat table:
SELECT url, normalized_url, share_count, comments_fbid FROM link_stat
WHERE url = 'http://www.people.com/people/article/0,,20624518,00.html'
(See result in Graph API Explorer.) You can also use WHERE url IN ("…", "…", …) to check multiple URLs at once.
This also returns a comments_fbid of 10151022112466453, and that one you can look up via the API, https://graph.facebook.com/10151022112466453
Maybe this can work as a workaround, until Facebook fixes this problem.

URL length limit for google reader api

I am using "/reader/api/0/stream/items/ids" API to get the item ids for sources that I want.
I have quite a number of sources, so I repeated "s=" parameter to include in the api url.
However, google has given me an error of "URL is too long".
So the question is that How can I solve it so that I just use one time api call to get item ids for that many sources?
Thanks
It seems that /reader/api/0/stream/items/ids path supports a POST method. This means the amount of data you could pass by using POST verb is much more than by using a query string and a GET method.
So use https://www.google.com/reader/api/0/stream/items/ids URL for the post, and pass your query string as a post data. Don't forget to include an action token(T) which is required for POST requests.

Resources