PHP Twitter Oauth for just retreiving feeds

So I've been using Twitter PHP LIB for pulling user tweets & followers tweets. OpenAuth seems like overkill for this as I need to get the site itself to register for authentication.

Is there a simple library that I can use? Perhaps a basic Oath if you don't need authentication by the user at all?

Should I simply pull the RSS?=

--------------Solutions-------------

I made my own Twitter OAuth library. It still uses OAuth but the library is very small.

Also, you still need to register an app for it and get the access token.

If you want to check it out, here is it: I Just Want to Call Twitter’s API With My Own Account!

Basically you need the consumer key, the consumer secret, the access token and the access token secret, so you have to register your application at [dev.twitter.com] (http://dev.twitter.com/) using the user you want to authenticate, then you will get the first 2. On the same page, click on "My Access Token" and you will get the last 2.

Then you can:

$api = new OAuthDamnit(CONSUMER_KEY, CONSUMER_SECRET, ACCESS_TOKEN, ACCESS_TOKEN_SECRET);
echo $api->get('http://api.twitter.com/1/statuses/home_timeline.json', array());


There are other alternatives such as using PHP's OAuth Extension which I think might be faster, but is is also very simple to use.

$oauth = new OAuth(CONSUMER_KEY, CONSUMER_SECRET, OAUTH_SIG_METHOD_HMACSHA1, OAUTH_AUTH_TYPE_AUTHORIZATION);
$oauth->setToken(ACCESS_TOKEN, ACCESS_TOKEN_SECRET);
$oauth->fetch('http://api.twitter.com/1/statuses/home_timeline.json');
echo $oauth->getLastResponse();


Or if you don't want to use OAuth at all, you have Simple Auth Twitter which can act like a basic auth gateway.

You just have to sign it there and it will give you an API key. You use that as your Twitter password and use http://simpleauthtwitter.heroku.com/api/ as the API endpoint.

Category:php Time:2010-09-06 Views:1
Tags: php twitter

Related post

  • What to do with twitter oauth token once retreived? 2010-05-12

    I'm writing a web app that will use twitter as its primary log on method. I've written code which gets the oauth token back from Twitter. My plan is now to Find the entry in my Users table for the twitter username retreived using the token, or create

  • uninitialized constant Twitter::OAuth 2011-05-03

    I'm struggling to get my app to display a timeline of feeds from my app. So far I've used the oauth-plugin, oauth and twitter gems (for rails3) to get it authorised. This has worked just fine. Now I'm struggling when I try and connect. I end up with

  • Getting 401 on Twitter OAuth POST requests 2009-03-27

    I am trying to use Twitter OAuth and my POST requests are failing with a 401 (Invalid OAuth Request) error. For example, if I want to post a new status update, I am sending a HTTP POST request to https://twitter.com/statuses/update.json with the foll

  • uninitialized constant Twitter::OAuth - Overlooking a require somewhere? 2009-06-09

    I'm looking to use the latest Twitter gem for a Rails app I'm working on. However, executing the following line: oauth = Twitter::OAuth.new(ServiceAPIKeys.twitter['api_key'], ServiceAPIKeys.twitter['secret_key']) Triggers the following exception: uni

  • Testing strategies for Ruby on Rails & Twitter OAuth 2009-06-12

    I am developing an application that utilizes twitter oauth and ran into a brick wall trying to figure out how to test twitter oauth. Particularly trying to use Cucumber and Webrat/Selenium to do test the functionality -- Certain steps in the registra

  • twitter status message update through bot using php and twitter oauth 2009-06-16

    I have followed the steps defined in the following link for twitter oauth implementation. https://docs.google.com/View?docID=dcf2dzzs_2339fzbfsf4 Its working fine when i run through web browser but i want a user should be able to update status of twi

  • Twitter + OAuth + iPhone = fustration 2009-09-07

    I'm trying to implement http://github.com/bengottlieb/Twitter-OAuth-iPhone/tree/master into my code. I'm following the Demo provided and I can't seem to get it to work. Here is where I think the problem is currently. So the example declares a view co

  • Twitter+Oauth on iPhone: How do you logout? 2009-09-11

    I'm using http://github.com/bengottlieb/Twitter-OAuth-iPhone/tree/master for Twitter+Oauth in my iPhone app. I'm trying to create a facebook connect like feature where can log in and log out of twitter. This paticular Twitter+Oauth implementation doe

  • Authlogic Facebook Connect/Twitter oAuth helper issues 2009-10-28

    I am a complete newbie to the world of Ruby & Rails moving from the land of PHP & Symfony. I'm currently attempting to setup the Facebook Connect plugin & Twitter oAuth for authlogic. Authlogic works no problem but both of the others fail

  • Storing Twitter OAuth in MySQL 2009-10-30

    I'm about to add a feature on my website that will post stuff to the users' twitter accounts. I read that storing an "OAuth" token is better than storing their usernames and passwords (which makes sense). What should I store in my MySQL database? The

  • Cannot get Twitter-OAuth-iPhone to work 2009-11-21

    demo works as expected, no problems. But now I'm trying to integrate it into my project. I use no xib-s, code only: OAuthTwitterDemoViewController *vc = [[OAuthTwitterDemoViewController alloc] init]; [[UIApplication sharedApplication].keyWindow addSu

  • Twitter+OAuth Crash on iPhone OS 2.x 2009-11-25

    I'm using Ben Gottlieb's Twitter+OAuth code. Works great on my 3.1.2 iPhone, but crashes on my 2.2.1 iPhone. I'm getting a EXC_BAD_ACCESS error in the EstimateBas64EncodedDataSize call. Here's what I'm seeing in the debugger: #0 0x2fe1e724 in __dyld_

  • Twitter + oAuth nightmare 2009-12-02

    I'm trying to implement a custom login view to Twitter (I don't want that UIWebView). I've downloaded many classes, and I'm so far having a nightmare with this. Now I'm trying to make Twitter + oAuth work. Here's the demo code (that works): _engine =

  • Twitter Oauth duration of autorization 2009-12-24

    Does Twitter Oauth allow a user to authorize a consumer for a long period of time? For example, if a user uses a consumer app that generates status updates automatically, can the user authorize that consumer once and then let it send status updates f

  • Twitter OAuth with MGTwitterEngine 2009-12-27

    I'm using the MGTwitterEngine to connect to twitter and I want to use OAuth with the MGTwitterEngine? --------------Solutions------------- There's a modified version of MGTwitterEngine on GitHub that is supposed to use OAuth: http://github.com/kimpto

  • What is oauth_token_secret in Twitter OAuth 2010-01-02

    When I get an access token from Twitter I get something like the following: oauth_token=14410002-F5Bi8hMpQbXamM8MBBw8zw2LYIBL4FEBvxLZfaSwX&oauth_token_secret=K8QNvDcC2f9qtGU8tfa75exwLZ2Sc1jeHrThnk6Co&user_id=14410002&screen_name=blueonion

  • Help required on want to add Twitter OAuth just like facebook connect 2010-04-08

    I want to add twitter oauth just like facebook connect in my site like this site http://mytweeple.com/default.aspx. Need help on this how i can do this. Regards, --------------Solutions------------- Check out http://apiwiki.twitter.com/OAuth-FAQ You

  • "Find Friends" using Twitter Oauth or Facebook Connect connections 2010-04-19

    Using Twitter OAuth, I'm saving the user's data as JSON in a "twitter" field in my database. Likewise, I'm saving the user's Facebook Connect info (including persistent session_key) as JSON in a "facebook" field. For most operations, this is great. H

  • Using Twitter OAuth to post updates automatically 2010-04-25

    Here's my scenario. I have a web site, which automatically posts updates to Twitter using cURL at the moment. But I hear Twitter is going to turn this feature off and move to OAuth. I tried implementing OAuth in my site, but the user actually has to

Copyright (C) pcaskme.com, All Rights Reserved.

processed in 0.377 (s). 13 q(s)