Created
September 21, 2010 17:25
-
-
Save ssx/590085 to your computer and use it in GitHub Desktop.
Twitter API Example Call
This file contains 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 all the files we need | |
require "../lib/EpiCurl.php"; | |
require "../lib/EpiOAuth.php"; | |
require "../lib/EpiTwitter.php"; | |
// Your user tokens, these won't work as they are invalid, for more information | |
// on getting your own user tokens or how to register an application yourself, | |
// please watch http://www.youtube.com/watch?v=bg_wQEmAgaM which shows the | |
// whole process in detail | |
define("CONSUMER_KEY","uckeOs71FYxHCOZoMf5kpg"); | |
define("CONSUMER_SECRET","hTa5igD7jY0Ed3fRYNO8PpmgAsl1ikskvWVgy8dl0BA"); | |
define("OAUTH_TOKEN","194052389-l06W1IQdHs6D0Utd3eGOWjGVZsQZhDmxSJh0qzUz"); | |
define("OAUTH_TOKEN_SECRET","cO2NMspCpUUOluR8sDcAqGurMOX8I4vsznOKCnbTwQ"); | |
// Create a new object | |
$twitterObj = new EpiTwitter(CONSUMER_KEY, CONSUMER_SECRET, OAUTH_TOKEN, OAUTH_TOKEN_SECRET); | |
// Make a call to the API for verify_credentials | |
$creds = $twitterObj->get('/account/verify_credentials.json'); | |
// Echo output of response | |
echo var_dump($creds->response); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment