views:

126

answers:

6

I've been pushing stuff from our website to our company twitter account automatically. Like some news updates, updates to some sections of our site, etc ... It's all been happening automatically using the Zend Framekwork Twitter service, or other very simple php code that uses a username/password hardcoded.

Now, Twitter killed the old fashion authentication. Which is the right thing to do when offering twitter integration to customers (which use OAuth for user-centric stuff), but for internal stuff, isn't that overkill?

Is there an easy way to update my code to make it work again? Can I somehow hard code an oauth authentication key of some sort so that I don't have to create a whole login process with database storage for a single-user application?

A: 

If you already have your system set up to use oAuth, then yes you could just hard code your key and secret key into the system, but otherwise you will have to update to handle oAuth authentication.

Here is a great tutorial to get you in the right direction: http://blog.astrumfutura.com/archives/411-Writing-A-Simple-Twitter-Client-Using-the-PHP-Zend-Frameworks-OAuth-Library-Zend_Oauth.html

Edit:

To Clarify, there is no reason you can't set things up so you connect via oAuth and then just doing this:

$consumer_key = 'xxxxxxxxxxxxxxx';
$consumer_key_secret = 'xxxxxxxxxxxxxxx';
$access_token = 'xxxxxxxxx';
$access_token_secret = 'xxxxxxxx';

$auth = $this->twitter->oauth($consumer_key, $consumer_key_secret, $access_token, $access_token_secret);
Mike
A: 

You could Update your Zend Framework Version.

In Version 1.10.8 of the Framework is an major update for Twitter oAuth included, to make in work again.

Zend Framework 1.10.8 Release

ArneRie
A: 

Rob Allen wrote recently on his blog about Twitter and OAuth (and made a simple application also!): http://akrabat.com/zend-framework/tweetgt-an-example-of-zend_service_twitter-via-oath/

robertbasic
A: 

Shameless plug - I did a simple blog article on using Oauth with Zend_Service_Twitter. Like another poster said you should double check your ZF version first though.

seengee
A: 

Here is a recent article on this issue: http://www.webmonkey.com/2010/10/connect-to-twitter-without-oauth/

nute
A: 

Here's an article showing you how to use OAuth with Twitter and how to persist the authentication token. -- http://www.joeyrivera.com/2010/twitter-api-oauth-authentication-and-zend_oauth-tutorial/

Thanks, Joe.

ad2joe