dropfaith Posted February 17, 2017 Share Posted February 17, 2017 So i got the basis of this working here http://www.roguebrother.x10host.com/tweet.php what im trying to do is make it so it searches by not only username(complete) but also a certain hashtag (Duels) And get it to display any media (photos) in said tweet <?php require_once('TwitterAPIExchange.php'); /** Set access tokens here - see: https://dev.twitter.com/apps/ **/ $settings = array( 'oauth_access_token' => "831981818408677377-FexWOmvCyaZYWt3TYwmodmx3gMmFIqx", 'oauth_access_token_secret' => "L1vwbaBjsUivKn5NYVmGgve6V1lSP5THvjBk3LiadHyOj", 'consumer_key' => "t31OianjtopHhDEdeBAjWPqj3", 'consumer_secret' => "zFZpwrMl31BShY6CluYapaZl0K1CQPpsagBjVCMkTs2GtWHhRm" ); $url = "https://api.twitter.com/1.1/statuses/user_timeline.json"; $requestMethod = "GET"; $getfield = 'screen_name=MCoCTrucos&count=1'; $twitter = new TwitterAPIExchange($settings); $string = json_decode($twitter->setGetfield($getfield) ->buildOauth($url, $requestMethod) ->performRequest(),$assoc = TRUE); if($string["errors"][0]["message"] != "") {echo "<h3>Sorry, there was a problem.</h3><p>Twitter returned the following error message:</p><p> <em>".$string[errors][0]["message"]."</em></p>";exit();} foreach($string as $items) { echo "Tweeted by: ". $items['user']['name']."<br />"; echo "Screen name: ". $items['user']['screen_name']."<br />"; echo "Tweet: ". $items['text']."<br />"; echo "Time and Date of Tweet: ".$items['created_at']."<br />"; echo "Tweet ID: ".$items['id_str']."<br />"; echo "Followers: ". $items['user']['followers_count']."<br /><hr />"; } { echo $url;} ?> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.