2

I am trying to pull tweets matching the given search query. I'm using the following code :

import urllib2 as urllib
import json
response = urllib.urlopen("https://search.twitter.com/search.json?q=microsoft")
pyresponse = json.load(response)
print pyresponse

This was working a few days ago, but suddenly stopped working now. With some help from google, I learned that this type of url in not supported anymore.

How do I perform this search query. What url shall I use?

Andy Hayden
  • 359,921
  • 101
  • 625
  • 535
J Verma
  • 121
  • 5
  • What do you mean by stopped working? There's no exception. – Andy Hayden Jun 06 '13 at 17:10
  • 1
    I meant this script returned 15 tweets anytime I used it (believe me, I have tried with different keywords and have done some analysis on the tweets), but for past few days the script doesn't return any tweets. – J Verma Jun 06 '13 at 17:14
  • 1
    Also see second answer to this question http://stackoverflow.com/questions/5296183/twitter-hash-tag-search-query?rq=1 – J Verma Jun 06 '13 at 17:17
  • This thread could be interesting for you: http://stackoverflow.com/questions/12684765/twitter-api-returns-error-215-bad-authentication-data – Jingo Jun 06 '13 at 17:30

1 Answers1

4

Twitter is deprecating non-authenticated searches. You should look into Tweepy or another Python library that interacts with Twitter. https://github.com/tweepy/tweepy

jumbopap
  • 3,969
  • 5
  • 27
  • 47