How to fix the Twitter blogger.js script and make it work with the oAuth required by the v1.1 API

 In Javascript

Since the recent deactivation of the v.1 API of Twitter, the highly popular script was left nonfunctional.

There is a straightforward procedure to get it back running again by replacing

<script type="text/javascript" src=""></script>


By a call to a .php file that generates the same thing, but while authenticating to the proper twitter application you will be creating.

You would need to mostly follow the steps illustrated here:

In short, here’s how you can get it up and running quickly:

1. Setup a twitter application at (logging in with your own credentials). Save the consumer key & secret and access token & secret.

2. Download the TwitteroAuth library from here. You are only interested in the twitteroauth folder and it’s two files, which you will place next the .php script you are creating.

3. Create a twitterfeed.php file with the content provided in the tutorial, and fill in the variables (twitteruser / number of tweets and all the keys you’ve created at step 1):

You can download my version from here:

I’ve only made an adjustment to the json_encode($tweets) part of the script by adding the twitterCallback2 which calls the old blogger script, which lets you use this cross-domain regardless of the server settings.

4. Upload the twitterfeed.php along the twitteroauth with the two files inside next to it to a server running PHP 5+.

5. Replace the old call by one pointing to your newly created .php file, like this:

<script type=”text/javascript” src=””></script>

Recent Posts
  • surag

    Thank you very much!!

Leave a Comment

Contact Us

We're not around right now. But you can send us an email and we'll get back to you, asap.

Not readable? Change text. captcha txt

Start typing and press Enter to search