Using pecl/oauth to post to Twitter

I have seen a lot of questions about OAuth and specifically how to do OAuth from PHP. We have a new pecl oauth extension written by which does a really good job simplifying OAuth.



I added Twitter support to Slowgeek.com the other day and it was extremely painless. The goal was to let users have a way to have Slowgeek send a tweet on their behalf when they have completed a Nike+ run. Here is a simplified description of what I did.



First, I needed to get the user to authorize Slowgeek to tweet on their behalf. This is done by asking Twitter for an access token and secret which will be stored on Slowgeek. This access token and secret will allow us to act on behalf of the user. This is made a bit easier by the fact that Twitter does not expire access tokens at this point, so I didn't need to worry about an access token refresh workflow.







Continue reading "Using pecl/oauth to post to Twitter"
 •  0 comments  •  flag
Share on Twitter
Published on April 27, 2009 15:20
No comments have been added yet.


Rasmus Lerdorf's Blog

Rasmus Lerdorf
Rasmus Lerdorf isn't a Goodreads Author (yet), but they do have a blog, so here are some recent posts imported from their feed.
Follow Rasmus Lerdorf's blog with rss.