1

I'm new to the Twitter Search API and was wondering whether my code snippet below is deprecated?

    $json = json_decode(file_get_contents('http://search.twitter.com/search.json?q=to%3astackexchange'));

If so, can you give me an example of a version that is not deprecated? Thanks in advance.

Anthony
  • 3,990
  • 23
  • 68
  • 94
  • 1
    What makes you think it is? – Paul Dessert May 02 '13 at 17:12
  • +1 In the top right hand corner of the Twitter Search API page, they state version 1 (which is deprecated) and version 1.1 (which is not). So that confused me as to whether I'm looking at code that may be deprecated. – Anthony May 02 '13 at 17:14

1 Answers1

3

Yes, this code is deprecated.

The manual page links to the Twitter API v1.1 version.

Niels Keurentjes
  • 41,402
  • 9
  • 98
  • 136
  • +1 I was afraid of that. Hmmmm, so what is the alternative? Is it much more difficult? Requires oath? – Anthony May 02 '13 at 17:16
  • I see authentication is required for 1.1 version. Can you recommend a good tutorial on how to use this? – Anthony May 02 '13 at 17:17
  • 2
    There's some good sample code [here](http://stackoverflow.com/questions/12916539/simplest-php-example-retrieving-user-timeline-with-twitter-api-version-1-1). – Niels Keurentjes May 02 '13 at 17:20