I am making a GET request to twitter to receive a JSONP object back of most recent posts of a specific tag. Once I receive the data I loop through 开发者_运维问答the results array getting each tweet individually.
My problem I am having is that console.log(data.results[i].refresh_url); is giving me an undefined value. So my question is:
- Do you receive a refresh_url variable on all searches?
- If not, how is refresh_url used? I would have to find the latest post id in the loop and re-query using since_id= which defeats the purpose of using refresh_url.
$.getJSON("http://search.twitter.com/search.json?&callback=?&q=css", function(data) { for(var i in data.results) { console.log(data.results[i].refresh_url); } });
Thanks.
You're looking for refresh_url in the wrong place. It's outside of the result set.
Replace your logging line with
console.log(data.refresh_url);
This will give you to the URL to refresh from.
精彩评论