How to get a twitter feed using PHP WITHOUT using api 1.1 and without oauth

Hello folks! It’s been a while, I know =)

Recently twitter retired api 1.0 which was extremely useful and easy to implement. They’ve switched to API 1.1 which incurs mandatory authentication for every request as well as API limits. For many, this is fine and dandy but for others it throws a wrench in things.

For those of you who just want some easy to use code to pull a twitter feed, I present to you a little lunch time coding project I put together purely to give myself a chance to play with the amazingly awesome “Simple HTML Dom” class in PHP.

Simple HTML Dom makes it extremely easy to parse / scrape html without having to write complex regular expressions.. So what you see below is purely a demonstration of that.

Warning: This code should not be used in production, you risk getting your account blocked! This is PURELY for educational purposes.

 

Related search terms:

4 Responses to How to get a twitter feed using PHP WITHOUT using api 1.1 and without oauth

  1. RC says:

    Lonnie, does this code still work for you? I can get some Simple HTML Dom examples to work but not any for twitter, not even a recent one on stackoverflow. (I can still scrape public timelines with curl.)

    • lonnie says:

      I would be shocked it if it still worked, this code is an example of scraping … and twitter/facebook and others always change up the html markup… you could probably still use it as a base to write new code but honestly it’s a frustrating task.. they constantly change things and at least in the case of facebook, they are using randomly generated classes/ids which makes scripting virtually impossible without a lot of extra effort… a lot of sites like that are also making it so javascript is required… why? well the html is generated from the javascript… which makes PHP scripting entirely useless..

      it’s not impossible … but it’s become a mountain now.. not a mole hill as it used to be 🙂 .. I’m sorry to say, I myself have no longer tried to deal with it …

Leave a Reply to tallerespaterna Cancel reply

Your email address will not be published. Required fields are marked *