Hi people, I’m a student working on a project which involves using the Twitter Search API. My codes were working well months ago but it seems that with the new update to v1.1 the JSON request fails. I am clueless on what I need even after reading the documentation. I’m a terrible programmer so I will like to have some advice on how to make it work again.
These codes used to work well(I’m showing this because I’m totally lost on what went wrong):
function getTweets() {
var numOfTweets = 10;
var searchItem = ‘%23yolo’;
var retweet = 1;
var url = 'http://search.twitter.com/search.json?q='+searchItem+'&rpp='+numOfTweets+'&result_type=recent&include_rts='+retweet+'&callback=?';
$.getJSON(url, function (json) {
display = [];
displayDateTime = [];
if (json.results.length != null) {
for (var i = 0; i < json.results.length; i++) {
var tim = new Date(json.results[i].created_at);
display.push("@" + json.results[i].from_user + ": " + json.results[i].text);
displayDateTime.push("[" + tim.toString().substring(0, 19) + "]");
} //end of for loop
}); //end of getJSON
}//end of getTweets()
To my understanding it seems that I need either Application-only authentication or OAuth to get this going but have absolutely zero idea on where and how to start. All help are greatly appreciated.