[twitter-dev] Re: Question on example code

2009-07-16 Thread Abraham Williams
If you are trying to make unauthenticated calls  don't bother running them
through OAuth. Just call them directly using curl.

Abraham

On Thu, Jul 16, 2009 at 07:39, BarefootSanders mgold...@gmail.com wrote:


 Hi all.  I've been working on a twitter app using the new OAuth
 protocol and the example code provided by twitter (This is the code:
 http://github.com/abraham/twitteroauth).  I'm sure some of you have
 seen/used it before.  I had a question and was hoping someone could
 help me out.

 What I'm noticing is that when a twitter object is created, i.e.

 $to = new TwitterOAuth($consumer_key, $consumer_secret, $_SESSION
 ['oauth_access_token'], $_SESSION['oauth_access_token_secret']);

 The method OAuthRequest is called to actually perform the request from
 the Twitter api.  However when I look in the TwitterOAuth class there
 is no method named OAuthRequest.  There is a method named oAuthRequest
 (notice the change in case and I thought PHP was case sensitive) and
 I'm trying to figure out what function is actually being called.  It
 seems like oAuthRequest is being called because the params match up
 but idk.

 What I'm trying to do with this is actually make an unauthenticated
 request for api calls that dont need to be authenticated i.e.
 http://twitter.com/users/show.xml?screen_name=dougw

 So I changed the constructor to this.

 if ($_SESSION['oauth_access_token'] === NULL  $_SESSION
 ['oauth_access_token_secret'] === NULL) {
  /* Create TwitterOAuth object with app key/secret and token key/
 secret from default phase */
  $to = new TwitterOAuth($consumer_key, $consumer_secret, $_SESSION
 ['oauth_request_token'], $_SESSION['oauth_request_token_secret']);
  /* Request access tokens from twitter */
  $tok = $to-getAccessToken();

  /* Save the access tokens. Normally these would be saved in a
 database for future use. */
  $_SESSION['oauth_access_token'] = $tok['oauth_token'];
  $_SESSION['oauth_access_token_secret'] = $tok
 ['oauth_token_secret'];
}

 And want to do this:
 $to = new TwitterOAuth();
 $result = $to-OAuthRequest($url);

 print_r($result);

 But it's not working and I cant figure out what function is being
 called.

 Hope I didn't ramble to long.. Any help would be much appreciated.




-- 
Abraham Williams | Community Evangelist | http://web608.org
Hacker | http://abrah.am | http://twitter.com/abraham
Project | http://fireeagle.labs.poseurtech.com
This email is: [ ] blogable [x] ask first [ ] private.


[twitter-dev] Re: Question on example code

2009-07-16 Thread BarefootSanders

Should have included this - The underlying code uses curl so thats why
i was trying to use the methods that were there already.

On Jul 16, 8:51 am, Abraham Williams 4bra...@gmail.com wrote:
 If you are trying to make unauthenticated calls  don't bother running them
 through OAuth. Just call them directly using curl.

 Abraham





 On Thu, Jul 16, 2009 at 07:39, BarefootSanders mgold...@gmail.com wrote:

  Hi all.  I've been working on a twitter app using the new OAuth
  protocol and the example code provided by twitter (This is the code:
 http://github.com/abraham/twitteroauth).  I'm sure some of you have
  seen/used it before.  I had a question and was hoping someone could
  help me out.

  What I'm noticing is that when a twitter object is created, i.e.

  $to = new TwitterOAuth($consumer_key, $consumer_secret, $_SESSION
  ['oauth_access_token'], $_SESSION['oauth_access_token_secret']);

  The method OAuthRequest is called to actually perform the request from
  the Twitter api.  However when I look in the TwitterOAuth class there
  is no method named OAuthRequest.  There is a method named oAuthRequest
  (notice the change in case and I thought PHP was case sensitive) and
  I'm trying to figure out what function is actually being called.  It
  seems like oAuthRequest is being called because the params match up
  but idk.

  What I'm trying to do with this is actually make an unauthenticated
  request for api calls that dont need to be authenticated i.e.
 http://twitter.com/users/show.xml?screen_name=dougw

  So I changed the constructor to this.

  if ($_SESSION['oauth_access_token'] === NULL  $_SESSION
  ['oauth_access_token_secret'] === NULL) {
       /* Create TwitterOAuth object with app key/secret and token key/
  secret from default phase */
       $to = new TwitterOAuth($consumer_key, $consumer_secret, $_SESSION
  ['oauth_request_token'], $_SESSION['oauth_request_token_secret']);
       /* Request access tokens from twitter */
       $tok = $to-getAccessToken();

       /* Save the access tokens. Normally these would be saved in a
  database for future use. */
       $_SESSION['oauth_access_token'] = $tok['oauth_token'];
       $_SESSION['oauth_access_token_secret'] = $tok
  ['oauth_token_secret'];
     }

  And want to do this:
  $to = new TwitterOAuth();
  $result = $to-OAuthRequest($url);

  print_r($result);

  But it's not working and I cant figure out what function is being
  called.

  Hope I didn't ramble to long.. Any help would be much appreciated.

 --
 Abraham Williams | Community Evangelist |http://web608.org
 Hacker |http://abrah.am|http://twitter.com/abraham
 Project |http://fireeagle.labs.poseurtech.com
 This email is: [ ] blogable [x] ask first [ ] private.- Hide quoted text -

 - Show quoted text -


[twitter-dev] Re: Question on example code

2009-07-16 Thread BarefootSanders

Yea I was going to do that but I had the class made there already..
The call It's not actually running through OAuth.. it just creates the
object so it can use the methods already written.  I was trying to use
what was there already.

On Jul 16, 8:51 am, Abraham Williams 4bra...@gmail.com wrote:
 If you are trying to make unauthenticated calls  don't bother running them
 through OAuth. Just call them directly using curl.

 Abraham





 On Thu, Jul 16, 2009 at 07:39, BarefootSanders mgold...@gmail.com wrote:

  Hi all.  I've been working on a twitter app using the new OAuth
  protocol and the example code provided by twitter (This is the code:
 http://github.com/abraham/twitteroauth).  I'm sure some of you have
  seen/used it before.  I had a question and was hoping someone could
  help me out.

  What I'm noticing is that when a twitter object is created, i.e.

  $to = new TwitterOAuth($consumer_key, $consumer_secret, $_SESSION
  ['oauth_access_token'], $_SESSION['oauth_access_token_secret']);

  The method OAuthRequest is called to actually perform the request from
  the Twitter api.  However when I look in the TwitterOAuth class there
  is no method named OAuthRequest.  There is a method named oAuthRequest
  (notice the change in case and I thought PHP was case sensitive) and
  I'm trying to figure out what function is actually being called.  It
  seems like oAuthRequest is being called because the params match up
  but idk.

  What I'm trying to do with this is actually make an unauthenticated
  request for api calls that dont need to be authenticated i.e.
 http://twitter.com/users/show.xml?screen_name=dougw

  So I changed the constructor to this.

  if ($_SESSION['oauth_access_token'] === NULL  $_SESSION
  ['oauth_access_token_secret'] === NULL) {
       /* Create TwitterOAuth object with app key/secret and token key/
  secret from default phase */
       $to = new TwitterOAuth($consumer_key, $consumer_secret, $_SESSION
  ['oauth_request_token'], $_SESSION['oauth_request_token_secret']);
       /* Request access tokens from twitter */
       $tok = $to-getAccessToken();

       /* Save the access tokens. Normally these would be saved in a
  database for future use. */
       $_SESSION['oauth_access_token'] = $tok['oauth_token'];
       $_SESSION['oauth_access_token_secret'] = $tok
  ['oauth_token_secret'];
     }

  And want to do this:
  $to = new TwitterOAuth();
  $result = $to-OAuthRequest($url);

  print_r($result);

  But it's not working and I cant figure out what function is being
  called.

  Hope I didn't ramble to long.. Any help would be much appreciated.

 --
 Abraham Williams | Community Evangelist |http://web608.org
 Hacker |http://abrah.am|http://twitter.com/abraham
 Project |http://fireeagle.labs.poseurtech.com
 This email is: [ ] blogable [x] ask first [ ] private.- Hide quoted text -

 - Show quoted text -


[twitter-dev] Re: Question on example code

2009-07-16 Thread Abraham Williams
The problem though is that OAuthRequest() makes a signed OAuth request that
I'm sure Twitter does not know how to handle.

You can probably however use http() instead as that is just a curl wrapper.

Abraham

On Thu, Jul 16, 2009 at 08:10, BarefootSanders mgold...@gmail.com wrote:


 Yea I was going to do that but I had the class made there already..
 The call It's not actually running through OAuth.. it just creates the
 object so it can use the methods already written.  I was trying to use
 what was there already.

 On Jul 16, 8:51 am, Abraham Williams 4bra...@gmail.com wrote:
  If you are trying to make unauthenticated calls  don't bother running
 them
  through OAuth. Just call them directly using curl.
 
  Abraham
 
 
 
 
 
  On Thu, Jul 16, 2009 at 07:39, BarefootSanders mgold...@gmail.com
 wrote:
 
   Hi all.  I've been working on a twitter app using the new OAuth
   protocol and the example code provided by twitter (This is the code:
  http://github.com/abraham/twitteroauth).  I'm sure some of you have
   seen/used it before.  I had a question and was hoping someone could
   help me out.
 
   What I'm noticing is that when a twitter object is created, i.e.
 
   $to = new TwitterOAuth($consumer_key, $consumer_secret, $_SESSION
   ['oauth_access_token'], $_SESSION['oauth_access_token_secret']);
 
   The method OAuthRequest is called to actually perform the request from
   the Twitter api.  However when I look in the TwitterOAuth class there
   is no method named OAuthRequest.  There is a method named oAuthRequest
   (notice the change in case and I thought PHP was case sensitive) and
   I'm trying to figure out what function is actually being called.  It
   seems like oAuthRequest is being called because the params match up
   but idk.
 
   What I'm trying to do with this is actually make an unauthenticated
   request for api calls that dont need to be authenticated i.e.
  http://twitter.com/users/show.xml?screen_name=dougw
 
   So I changed the constructor to this.
 
   if ($_SESSION['oauth_access_token'] === NULL  $_SESSION
   ['oauth_access_token_secret'] === NULL) {
/* Create TwitterOAuth object with app key/secret and token key/
   secret from default phase */
$to = new TwitterOAuth($consumer_key, $consumer_secret, $_SESSION
   ['oauth_request_token'], $_SESSION['oauth_request_token_secret']);
/* Request access tokens from twitter */
$tok = $to-getAccessToken();
 
/* Save the access tokens. Normally these would be saved in a
   database for future use. */
$_SESSION['oauth_access_token'] = $tok['oauth_token'];
$_SESSION['oauth_access_token_secret'] = $tok
   ['oauth_token_secret'];
  }
 
   And want to do this:
   $to = new TwitterOAuth();
   $result = $to-OAuthRequest($url);
 
   print_r($result);
 
   But it's not working and I cant figure out what function is being
   called.
 
   Hope I didn't ramble to long.. Any help would be much appreciated.
 
  --
  Abraham Williams | Community Evangelist |http://web608.org
  Hacker |http://abrah.am|http://twitter.com/abraham
  Project |http://fireeagle.labs.poseurtech.com
  This email is: [ ] blogable [x] ask first [ ] private.- Hide quoted text
 -
 
  - Show quoted text -




-- 
Abraham Williams | Community Evangelist | http://web608.org
Hacker | http://abrah.am | http://twitter.com/abraham
Project | http://fireeagle.labs.poseurtech.com
This email is: [ ] blogable [x] ask first [ ] private.


[twitter-dev] Re: Question on example code

2009-07-16 Thread BarefootSanders

It's strange but the http() method doesn't seem to be working.  Here
is my code:

$url = 'http://twitter.com/users/show.xml?screen_name=dougw';
$to = new TwitterOAuth();
$result = $to-http($url);
print_r($result);

And that doesn't print anything out.  Am I doing something wrong?

Thanks.

On Jul 16, 9:34 am, Abraham Williams 4bra...@gmail.com wrote:
 The problem though is that OAuthRequest() makes a signed OAuth request that
 I'm sure Twitter does not know how to handle.

 You can probably however use http() instead as that is just a curl wrapper.

 Abraham





 On Thu, Jul 16, 2009 at 08:10, BarefootSanders mgold...@gmail.com wrote:

  Yea I was going to do that but I had the class made there already..
  The call It's not actually running through OAuth.. it just creates the
  object so it can use the methods already written.  I was trying to use
  what was there already.

  On Jul 16, 8:51 am, Abraham Williams 4bra...@gmail.com wrote:
   If you are trying to make unauthenticated calls  don't bother running
  them
   through OAuth. Just call them directly using curl.

   Abraham

   On Thu, Jul 16, 2009 at 07:39, BarefootSanders mgold...@gmail.com
  wrote:

Hi all.  I've been working on a twitter app using the new OAuth
protocol and the example code provided by twitter (This is the code:
   http://github.com/abraham/twitteroauth).  I'm sure some of you have
seen/used it before.  I had a question and was hoping someone could
help me out.

What I'm noticing is that when a twitter object is created, i.e.

$to = new TwitterOAuth($consumer_key, $consumer_secret, $_SESSION
['oauth_access_token'], $_SESSION['oauth_access_token_secret']);

The method OAuthRequest is called to actually perform the request from
the Twitter api.  However when I look in the TwitterOAuth class there
is no method named OAuthRequest.  There is a method named oAuthRequest
(notice the change in case and I thought PHP was case sensitive) and
I'm trying to figure out what function is actually being called.  It
seems like oAuthRequest is being called because the params match up
but idk.

What I'm trying to do with this is actually make an unauthenticated
request for api calls that dont need to be authenticated i.e.
   http://twitter.com/users/show.xml?screen_name=dougw

So I changed the constructor to this.

if ($_SESSION['oauth_access_token'] === NULL  $_SESSION
['oauth_access_token_secret'] === NULL) {
     /* Create TwitterOAuth object with app key/secret and token key/
secret from default phase */
     $to = new TwitterOAuth($consumer_key, $consumer_secret, $_SESSION
['oauth_request_token'], $_SESSION['oauth_request_token_secret']);
     /* Request access tokens from twitter */
     $tok = $to-getAccessToken();

     /* Save the access tokens. Normally these would be saved in a
database for future use. */
     $_SESSION['oauth_access_token'] = $tok['oauth_token'];
     $_SESSION['oauth_access_token_secret'] = $tok
['oauth_token_secret'];
   }

And want to do this:
$to = new TwitterOAuth();
$result = $to-OAuthRequest($url);

print_r($result);

But it's not working and I cant figure out what function is being
called.

Hope I didn't ramble to long.. Any help would be much appreciated.

   --
   Abraham Williams | Community Evangelist |http://web608.org
   Hacker |http://abrah.am|http://twitter.com/abraham
   Project |http://fireeagle.labs.poseurtech.com
   This email is: [ ] blogable [x] ask first [ ] private.- Hide quoted text
  -

   - Show quoted text -

 --
 Abraham Williams | Community Evangelist |http://web608.org
 Hacker |http://abrah.am|http://twitter.com/abraham
 Project |http://fireeagle.labs.poseurtech.com
 This email is: [ ] blogable [x] ask first [ ] private.- Hide quoted text -

 - Show quoted text -


[twitter-dev] Re: Question on example code

2009-07-16 Thread BarefootSanders

And I'm still a bit confused.. what method is being called when this
is called:

$to-OAuthRequest()

There is no method that matches the name/case of that method anywhere.

On Jul 16, 9:34 am, Abraham Williams 4bra...@gmail.com wrote:
 The problem though is that OAuthRequest() makes a signed OAuth request that
 I'm sure Twitter does not know how to handle.

 You can probably however use http() instead as that is just a curl wrapper.

 Abraham





 On Thu, Jul 16, 2009 at 08:10, BarefootSanders mgold...@gmail.com wrote:

  Yea I was going to do that but I had the class made there already..
  The call It's not actually running through OAuth.. it just creates the
  object so it can use the methods already written.  I was trying to use
  what was there already.

  On Jul 16, 8:51 am, Abraham Williams 4bra...@gmail.com wrote:
   If you are trying to make unauthenticated calls  don't bother running
  them
   through OAuth. Just call them directly using curl.

   Abraham

   On Thu, Jul 16, 2009 at 07:39, BarefootSanders mgold...@gmail.com
  wrote:

Hi all.  I've been working on a twitter app using the new OAuth
protocol and the example code provided by twitter (This is the code:
   http://github.com/abraham/twitteroauth).  I'm sure some of you have
seen/used it before.  I had a question and was hoping someone could
help me out.

What I'm noticing is that when a twitter object is created, i.e.

$to = new TwitterOAuth($consumer_key, $consumer_secret, $_SESSION
['oauth_access_token'], $_SESSION['oauth_access_token_secret']);

The method OAuthRequest is called to actually perform the request from
the Twitter api.  However when I look in the TwitterOAuth class there
is no method named OAuthRequest.  There is a method named oAuthRequest
(notice the change in case and I thought PHP was case sensitive) and
I'm trying to figure out what function is actually being called.  It
seems like oAuthRequest is being called because the params match up
but idk.

What I'm trying to do with this is actually make an unauthenticated
request for api calls that dont need to be authenticated i.e.
   http://twitter.com/users/show.xml?screen_name=dougw

So I changed the constructor to this.

if ($_SESSION['oauth_access_token'] === NULL  $_SESSION
['oauth_access_token_secret'] === NULL) {
     /* Create TwitterOAuth object with app key/secret and token key/
secret from default phase */
     $to = new TwitterOAuth($consumer_key, $consumer_secret, $_SESSION
['oauth_request_token'], $_SESSION['oauth_request_token_secret']);
     /* Request access tokens from twitter */
     $tok = $to-getAccessToken();

     /* Save the access tokens. Normally these would be saved in a
database for future use. */
     $_SESSION['oauth_access_token'] = $tok['oauth_token'];
     $_SESSION['oauth_access_token_secret'] = $tok
['oauth_token_secret'];
   }

And want to do this:
$to = new TwitterOAuth();
$result = $to-OAuthRequest($url);

print_r($result);

But it's not working and I cant figure out what function is being
called.

Hope I didn't ramble to long.. Any help would be much appreciated.

   --
   Abraham Williams | Community Evangelist |http://web608.org
   Hacker |http://abrah.am|http://twitter.com/abraham
   Project |http://fireeagle.labs.poseurtech.com
   This email is: [ ] blogable [x] ask first [ ] private.- Hide quoted text
  -

   - Show quoted text -

 --
 Abraham Williams | Community Evangelist |http://web608.org
 Hacker |http://abrah.am|http://twitter.com/abraham
 Project |http://fireeagle.labs.poseurtech.com
 This email is: [ ] blogable [x] ask first [ ] private.- Hide quoted text -

 - Show quoted text -