Twitter REST API 1.1 to create Twitter Apps using PHP & Javascript

Since twitter has released their new REST API (v1.1), there are some changes which affects quite alot of twitter apps developed based on older API. To prevent malicious use of the Twitter API and gain an understanding of what types of applications are accessing the API, twitter has put some restrictions. Here is the list of changes according to twitter offical blog:

  • required authentication on every API endpoint
  • a new per-endpoint rate-limiting methodology
  • changes to our Developer Rules of the Road, especially around applications that are traditional Twitter clients.

I am going to show you how can you use new twitter API (v1.1) to develop jQuery plugins or any Javascript apps. After having a look at different approaches, I found quite a simple solution which I will explain in this post.

Twitter API PHP

Make sure you have hosting that supports PHP. Next go to twitter-api-php and download the files OR simply click here to download the files.

Next create a folder called twitter or anything you want on your server and upload all the files after unzipping it.

You can delete all files safely and leave TwitterAPIExchange.php & index.php.

Create a twitter APP

Login to twitter and than navigate to the twitter apps site.

Click ‘Create New App’ button provided on the top right hand side.

Enter the name of your application e.g ‘My first app to test v1.1′

Similarly enter description and the website URL where from where you will be accessing the twitter api.

Note: In the website you don’t need to provide full path to twitter folder you created in previous steps. It should look like http://www.mydomain.com.

You can leave Callback URL empty for now.

Click ‘Yes, I agree’ checkbox and finally click ‘Create your twitter application’ button.

Continue Reading →

Copyright © 2018 — musings of Aamir Afridi