3

I want search for tweets in twitter. It is not working.

$parameters = array('q' => 'oauth');
$result = $connection->get('search', $parameters);

But when I do a user search it working perfectly.

$parameters = array('q' => 'oauth');
$result = $connection->get('users/search', $parameters);

I have also tried the below and that is also not working

$parameters = array('q' => 'oauth');
$result = $connection->get('search/tweets', $parameters);

What could be the reason?

Error message

stdClass Object
(
    [errors] => Array
        (
            [0] => stdClass Object
                (
                    [message] => Sorry, that page does not exist
                    [code] => 34
                )

        )

)
iltempo
  • 15,718
  • 8
  • 61
  • 72
simpleuser
  • 479
  • 5
  • 16
  • "It is not working" is NOT a valid explanation of your problem. Is there an error somewhere? What is the error message? Does it fail? Where? Does it produce a result? What are you expecting? – Jocelyn Oct 13 '12 at 17:55
  • @Jocelyn Thank you very much much for your response. I have updated the post. Could you please help – simpleuser Oct 17 '12 at 06:01

1 Answers1

7

You seem to be using the library TwitterOAuth by Abraham Williams.

I know this is an old question but I have just had the same problem as OP and it might keep happening to anyone else since apparently this library has not been updated for a while.

The problem seems to be that Twitter is no longer accepting requests via the version 1 of their API. You have to change the $host variable in the file twitteroauth.php as follows:

/* Set up the API root URL. */
//public $host = "https://api.twitter.com/1/";
public $host = "https://api.twitter.com/1.1/";
jmic
  • 907
  • 2
  • 10
  • 22