Extensions » Tweet Display Back

Tweet Display Back

Preventing the "Exceeded Queries" Message

Because of Twitter's API limiting and user settings, users occasionally receive the "This user has reached the maximum allowable queries against Twitter's API for the hour" message. By optimizing your settings, you can prevent this message being a common occurrence.

Prior to 2.1.4 - What's Happening?

Data is pulled from the user_timeline or lists/statuses endpoint on the Twitter REST API. Twitter implements a 150 query per hour limit on each account on this API. This means that if your account queries this API over 150 times in one hour, then until the reset time, you won't be able to pull data. Tweet Display Back is not the only extension/application affected, nor is it the only one to affect the remaining query count; all applications, be it desktop clients or Joomla! extensions that pull data from this API count against the 150 query limit.

The Technical Details

Tweet Display Back makes three queries to render the module.  The first one, which does not affect the count, is a check to see if there are any remaining queries on the account.  If this value is 0, you get the "exceeded queries" message.  If there are hits remaining, the next query pulls data from the users/show endpoint.  This is where your header information is compiled from.  Because of how lists are pulled, this query cannot be avoided to ensure that the correct data is rendered.  The final query goes to the statuses end point for the type of feed you are rendering.

In between the second and third queries, and after the third query, checks are performed to verify that data was actually returned and is present to work with.  If there isn't, a "Due to an error, potentially a timed-out connection to Twitter, this user's tweets are unable to be displayed" message is displayed in the module's position.  This may or may not include the profile information, depending on where in the processing the error was returned.

How Can I Control This?

The best way to help getting the "exceeded queries" message is to enable the module's cache in the Advanced Parameters.  The cache lifetime is set in seconds on this screen and converted as appropriate depending on the Joomla! version.  My suggestion is a minimum of 10 minutes for the cache life (600 seconds).  The default is 15 minutes (900 seconds).  Although caching means that your data will not be up-to-the-minute, this does help to ensure that on every page load, you will display tweets instead of a message.

2.1.4 and Newer - What's Happening?

In 2.1.4, the code that explicitly checked the rate limit portion of the API has been removed.  This code was the first code executed and was very inconsistent in reporting accurate data concerning the rate limiting.  Now, the connection's headers are checked when the data is retrieved to check for the specific error message stating the API rate limit has been reached.  So, if the message is displayed on your site, it should be an accurate representation of what's actually happening.