Try printing $t after you make the get request. Where you are printing $t now it doesn't contain any info from the actual request. I also don't see anything printed from $v. $v should be printing any error messages returned from Twitter. If $v is not printing anything or http_code is 0 then your server is probably are able to connect to https://api.twitter.com.
Abraham ------------- Abraham Williams | Hacker Advocate | abrah.am @abraham <https://twitter.com/abraham> | github.com/abraham | blog.abrah.am This email is: [ ] shareable [x] ask first [ ] private. On Mon, Jan 3, 2011 at 20:26, Dave The Happy Singer < [email protected]> wrote: > Hi there, > > Based on the instructions at: https://gist.github.com/564882, I am trying > to set up the TwitterOAuth object, but I seem to be falling at the first > hurdle, even before I try authenticating another user. > > With the code: > > <pre> > <?php > error_reporting(E_ALL); > require_once('twitteroauth/twitteroauth.php'); > require_once('config.php'); > $t = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET, OAUTH_TOKEN, > OAUTH_TOKEN_SECRET); > > print_r($t); > $v = $t->get('account/verify_credentials'); > print_r($v); > ?> > </pre> > > I am getting the following output: > > TwitterOAuth Object > ( > [http_code] => > [url] => > [host] => https://api.twitter.com/1/ > [timeout] => 30 > [connecttimeout] => 30 > [ssl_verifypeer] => > [format] => json > [decode_json] => 1 > [http_info] => > [useragent] => TwitterOAuth v0.2.0-beta2 > [sha1_method] => OAuthSignatureMethod_HMAC_SHA1 Object > ( > ) > > [consumer] => OAuthConsumer Object > ( > [key] => <apparently correct> > [secret] => <apparently correct> > [callback_url] => > ) > > [token] => OAuthConsumer Object > ( > [key] => <apparently correct> > [secret] => <apparently correct> > [callback_url] => > ) > > ) > > As you can see, I am not getting the methods 'get', 'post' etc. in my > object $t when I instantiate it, and I can go no further. > > I'm confuzzled, and would be grateful for any tips! > > Dave > > -- > Twitter developer documentation and resources: http://dev.twitter.com/doc > API updates via Twitter: http://twitter.com/twitterapi > Issues/Enhancements Tracker: > http://code.google.com/p/twitter-api/issues/list > Change your membership to this group: > http://groups.google.com/group/twitter-development-talk > -- Twitter developer documentation and resources: http://dev.twitter.com/doc API updates via Twitter: http://twitter.com/twitterapi Issues/Enhancements Tracker: http://code.google.com/p/twitter-api/issues/list Change your membership to this group: http://groups.google.com/group/twitter-development-talk
