Re: [twitter-dev] Hello with OAuth connection

2011-03-25 Thread Abraham Williams
You are not formatting the GET request correctly and TwitterOAuth
automatically parses the JSON response for you.


get('statuses/user_timeline',
array('screen_name' = $twitterUser'));

Abraham
-
Abraham Williams | Hacker Advocate | abrah.am
Just launched from Answerly :
InboxQfor Chrome
@abraham  | github.com/abraham | blog.abrah.am
This email is: [ ] shareable [x] ask first [ ] private.



On Fri, Mar 25, 2011 at 14:50, Jon  wrote:

> Hello,
>
> I am having trouble with the below code... I am trying to pull a
> user's timeline. Can someone please let me know where I've gone wrong?
>
>  /* Load required lib files. */
>  require_once('twitteroauth/twitteroauth.php'); /* This is the
> library for connecting with oAuth */
>  require_once('config.php'); /* This is the file that contains
> the oAuth credentials - this will be different for each app */
>
> //$twitterUser = 'YOUR_FRIENDS_USERNAME';
> $twitterUser = $field_twitter_url;
>
>
>  /* Create a TwitterOauth object with consumer/user tokens. */
>  $connection = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET,
> OAUTH_TOKEN, OAUTH_TOKEN_SECRET);
>
>  $xml = $connection->get('statuses/user_timeline.xml?screen_name=
> $twitterUser');
>  $xml = new SimpleXMLElement($xml);
>
>
> Thanks,
>
> Jon
>
> --
> 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


[twitter-dev] Hello with OAuth connection

2011-03-25 Thread Jon
Hello,

I am having trouble with the below code... I am trying to pull a
user's timeline. Can someone please let me know where I've gone wrong?

get('statuses/user_timeline.xml?screen_name=
$twitterUser');
  $xml = new SimpleXMLElement($xml);


Thanks,

Jon

-- 
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