Last active
August 29, 2015 14:20
-
-
Save mikestratton/2de20cad42e4988e5298 to your computer and use it in GitHub Desktop.
Connect to Twitter API, perform search and return results as JSON formatted data.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once('TwitterAPIExchange.php'); | |
$settings = array( | |
'oauth_access_token' => "", | |
'oauth_access_token_secret' => "", | |
'consumer_key' => "", | |
'consumer_secret' => "" | |
); | |
$url = 'https://api.twitter.com/1.1/search/tweets.json'; | |
$getfield = '?q=PSYCHO&result_type=recent&count=100'; | |
$requestMethod = 'GET'; | |
$twitter = new TwitterAPIExchange($settings); | |
echo $twitter->setGetfield($getfield) | |
->buildOauth($url, $requestMethod) | |
->performRequest(); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment