Twitter Feeds Widget with OAuth support

Twitter Feeds Widget with OAuth support

Released 5 years ago , Last update 5 years ago

Display Twitter Feeds on your website with a Javascript widget. This widget communicates with a PHP script that takes care of the OAuth requirements for access to the Twitter REST API.

This script can be used to show Twitter feeds on your website. The script uses AJAX and PHP to display the Twitter data on your website.

The script makes use of the Twitter REST API v1.1, which requires OAuth authentication to retrieve data. Version 1.0 of the Twitter API did not require authentication and has been retired by Twitter on June 11 of 2013. So all scripts that rely on version 1.0 of the Twitter API and do not use OAuth authentication stopped working after Twitter retired version 1.0 of their API. But this script still works!

This script provides a PHP file that can access the Twitter REST API version 1.1. It takes care of all the OAuth signing for the Twitter API requests. It also provides an option to cache the results of requests to the Twitter API to prevent rate limiting. The Javascript objects provided by this script use the PHP file via AJAX requests to retrieve the Twitter data you would like to display on your website.

The script also provides a default stylesheet for the output of the Twitter data. You can use this directly in your website, or use it as a basis for your own styling.

Default implementations are provided for the most-used Twitter data:

  • Home timeline
  • User timeline
  • Mentions timeline
  • Retweets of me
  • Search

But the script can also display other data that can be retrieved via the Twitter API, however, this requires some more configuration. But this is all covered in the documentation provided with this script.

The script works with a minimal amount of configuration, but it is also highly customizable:

  • Display multiple widgets
  • Display time elapsed since tweets or actual date/time of a tweet
  • Date/time formatting if actual date/time of a tweet are shown
  • Auto refresh
  • Templating for full control of the HTML output of the script


14 day 14-day money-back guarantee


Single site license

  • Perpetual license

  • 1 site, 1 server

  • No distribution (hosted use only)

  • Commercial use


Developer License

  • Perpetual license

  • 5 projects

  • Can distribute code and binary products

  • Commercial use

3 licenses, starting from From » $9.99 View Licenses

Get A Quote

What do you need?
  • Custom development
  • Integration
  • Customization / Reskinning
  • Consultation
When do you need it?
  • Soon
  • Next week
  • Next month
  • Anytime

Thanks for getting in touch!

Your quote details have been received and we'll get back to you soon.

Or enter your name and Email
  • J Jan 5 years ago
    Dear Jan-Henk, Following my earlier comments, I am afrais I am in need of your assistance. The widget works fine, but if I activate the cache (true) no tweets are displayed. I tried several options in the ajax.php but I remain a homer simpson... The cache directory is in the root and writable so my guess is that I have set the path to the directory not in the correct way. This is where the directory is: What is the correct way to set this path in ajax.php? Or is there something I overlooked? Thank you in advance, Jan.
    • JG Jan-Henk Gerritsen Publisher 5 years ago
      I guess you are still mixing up URLs and local file system paths. But hopefully the following will help. If you can reach the ajax.php file via, you can leave the default setting in the ajax.php file, which is: define('CACHE_DIR', dirname(__FILE__) . '/cache'); If this is already what you have the problem is not with your CACHE_DIR setting, but something else. If your ajax.php file is located somewhere else, the code above will not work. In that case can you provide me with the location of the ajax.php file?
  • J Jan-Henk 5 years ago
    I am out of the country right now. I will provide you with a link when i am back home in a few days.
    • J Jan 5 years ago
      Thanks for your reply Henk. I did purchase your widget yesterday but it always nice to see how others are using it. Anyway, I installed the widget as per your install but I do receive the following on my html I am using to test the widget: "Tweets" (for a very short period of time) followed by "Ajax error" and figure "0". My set-up is as follows on the server: a directory for the widget files \twitter and a directory for the JG_Cache \twitter\cache I do understand the cache file needs to be in its own directory. The file is writable. In the ajax.php I do use the full path to the file, like this: "" In the html the full paths are used. Any suggestions what I overlooked? Many thanks, Jan.
    • JG Jan-Henk Gerritsen Publisher 5 years ago
      I uploaded a new version of the script, this version contains an additional folder with examples of how you can use the script. But these examples only cover the Javascript configuration possibilities. If you enable the cache, the CACHE_DIR constant in the ajax.php file should be the full path to a directory on your webserver (e.g. \var\www\\public_html\twitter\cache), not a path to a file and it should also not be an URL (so no As for the error, do you also get this when you disable caching in the ajax.php file?
    • J Jan 5 years ago
      Dear Jan-Henk, many thanks. It works now! Thanks for your support. Jan.
  • J Jan 5 years ago
    Hi, Can you provide a link with some samples please? Thanks, Jan.