Latest Tweet
Description
This plugin displays the latest non-reply tweet from a user’s twitter timeline. Tweets are fetched using the twitter API via PHP and cached by WordPress to reduce API calls. No javascript required.
Features
- Fetches latest tweet using twitter API
- Caches twitter timeline using WordPress built-in cache
- Adjustable update frequency
- Customize output with template
- Server-side processing, no JavaScript, no delays
Installation
- Upload `latest-tweet` to the `/wp-content/plugins/` directory
- Activate the plugin through the ‘Plugins’ menu in WordPress
- Configure the plugin in the Settings > Latest Tweet menu screen
- Include
get_latest_tweet()
in your theme - For best practice, you should verify the function exists in your theme code before calling it:
if (function_exists('get_latest_tweet')) get_latest_tweet();
Usage
get_latest_tweet( $options, $output )
- options (array) – override control panel settings
- output (boolean) – echo output if true, return if false [default:true]
option | type | default | description |
---|---|---|---|
screen_name | string | n/a | Your twitter screen name (username). |
tweets_to_check | integer | 10 | The number of tweets to request from twitter. If you tend to have a lot of consecutive @replies in your stream, it is best to set this higher to avoid a reply showing on your site. |
html_template | string | ** | The code to print out for the tweet. |
Requirements
- Latest Tweet has been tested on WordPress 3.0. Earlier versions may work, but are unsupported.
- PHP 5 running on your server
Download
Latest Tweet Plugin 1.1.0
Last updated: 2010-07-25
Version History
-
= 1.1.0 = July 25, 2010
- Updates via wp_schedule_event instead of in the output function to eliminate hesitant page loads
- Changed function call to get_latest_tweet
- Added ability to fetch result and suppress output
- Consolidated settings
- Converted to class to reduce risk of function collision
-
= 1.0.1 = March 18, 2010
- Better handling of errors when twitter fails to respond
-
= 1.0.0 = December 30, 2009
- Initial release.