I am trying to get the JSON object which will contain tweets of a particular handle.
Here is the function I am using to send requests and store response in local storage:
function sendRequest(handle, noOfTweets, boolDisplay){
$.getJSON("http://search.twitter.com/search.json?q=from:"+handle+"&rpp="+noOfTweets+"&callback=?", function(data) {
if(boolDisplay){
displayTweets(data);
}
localStorage.setItem("tweets"+handle, JSON.stringify(data));
});
}
I am getting responses containing tweets of the user IF the user name doesn’t contain numbers.
If the handle contains any numbers, then there are no tweets returned.
I have tried it by directly using address bar for the same requests.
eg:
(Following are handle names)
- ndtv works
- toi works
- pranavjain64 (my handle) doesn’t work
- CNBCTV18news doesn’t work
PLEASE HELP!!
You’ll want to use the status api rather than search here.
https://dev.twitter.com/docs/api/1/get/statuses/user_timeline