• 0

php Twitter access w/out oAuth


Question

I need to make a simple php twitter client that is tied to a single twitter account. I want to include the username/pass in the code and not to use a login since this is only for a single person and a single account. Is it possible to do this without the new oauth communication?

Link to comment
Share on other sites

8 answers to this question

Recommended Posts

  • 0

You could just get the oauth token and oauth token secret and put it there, so you don't have to log in every single time. For example

$access_token['oauth_token'] = 'asdkasjdi943r43jkdfj934krfasda4f4';
$access_token['oauth_token_secret'] = '23423laksd3d34fd34df34r43d43d';
$connection = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET, $access_token['oauth_token'], $access_token['oauth_token_secret']);

$connection->post('statuses/update', array('status' => 'This works'));

Get the class from http://github.com/abraham/twitteroauth

Have a look at the different methods http://dev.twitter.com/doc

FYI: The tokens I provided are not real.

And as Cupcakes mentioned, the only way to communicate is by using OAuth. Basic Authentication is dead.

Link to comment
Share on other sites

  • 0

OK, I managed to do oAuth authorization without logging in everytime like you mentioned iHazCool, and it worked for a dozen of posts, but I have a final concern, is the token indefinite or does it have a time/no. of connections kind of limit? Will I ever be needing to see the login again?

Link to comment
Share on other sites

  • 0

OK, I managed to do oAuth authorization without logging in everytime like you mentioned iHazCool, and it worked for a dozen of posts, but I have a final concern, is the token indefinite or does it have a time/no. of connections kind of limit? Will I ever be needing to see the login again?

There is a rate limit but the OAuth tokens are for life. 350 requests per hour.

http://dev.twitter.com/pages/rate-limiting

However, if the owner of the account revokes access of your app, you no longer have access to the account meaning that you can't post updates anymore.

http://twitter.com/settings/connections

Link to comment
Share on other sites

  • 0

It's just a test to use a single account for collaborating on a project. 350 posts/hour will be more than enough but I'm just trying to make sure I know the limits.

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.