andrewbiggart / latest-tweets-php-o-auth

Twitters API v1.0 has now been retired. Here's a way you can pull your tweets from Twitter using PHP and OAuth.
129 stars 43 forks source link

Get tweets with hash tags #8

Open mohitathwani opened 11 years ago

mohitathwani commented 11 years ago

How can I use this script to get tweets with a particular hashtag instead of just tweets from my timeline ..??

I tried changing $get_tweets = $connection->get("https://api.twitter.com/1.1/statuses/user_timeline.json?screen_name=".$twitter_user_id."&count=".$tweets_to_display."&include_rts=".$include_rts."&exclude_replies=".$ignore_replies);

to $get_tweets = $connection->get("https://api.twitter.com/1.1/search/tweets.json?q=%40psatgames13");

but it doesnt work.

Please advise on how to proceed.

andrewbiggart commented 11 years ago

Hi mohitathwani,

Unfortunately I don't have time to look at this at the moment.

I'll try and get the functionality added asap.

You are along the right lines. However the formatting of the returned data will be slightly different for hastags, so you'll have to change the text and created on variables to match the change.

You can read more about this here. (https://dev.twitter.com/docs/api/1/get/search)

Hope this helps.

Andrew