Plugin Directory

Twitter Tools

Details

Twitter Tools integrates with Twitter by giving you the following functionality:

  • Archive your Twitter tweets (downloaded every 10 minutes)
  • Create a blog post from each of your tweets
  • Create a daily or weekly digest post of your tweets
  • Create a tweet on Twitter whenever you post in your blog, with a link to the blog post
  • Post a tweet from your sidebar
  • Post a tweet from the WP Admin screens
  • Pass your tweets along to another service (via API hook)

Configuration

There are a number of configuration options for Twitter Tools. You can find these in Options > Twitter Tools.

Showing Your Tweets

Widget Friendly

If you are using widgets, you can drag Twitter Tools to your sidebar to display your latest tweets.

Template Tags

If you are not using widgest, you can use a template tag to add your latest tweets to your sidebar.

<?php aktt_sidebar_tweets(); ?>

If you just want your latest tweet, use this template tag.

<?php aktt_latest_tweet(); ?>

Hooks/API

Twitter Tools contains a hook that can be used to pass along your tweet data to another service (for example, some folks have wanted to be able to update their Facebook status). To use this hook, create a plugin and add an action to:

aktt_add_tweet (action)

Your plugin function will receive an aktt_tweet object as the first parameter.

Example psuedo-code:

function my_status_update($tweet) { // do something here }
add_action('aktt_add_tweet', 'my_status_update')

Twitter Tools also provides a filter on the URL sent to Twitter so that you can run it through an URL-shortening service if you like.

tweet_blog_post_url (filter)

Your plugin function will receive the URL as the first parameter.

Example psuedo-code:

function my_short_url($long_url) {
    // do something here - return the shortened URL 
    $short_url = my_short_url_func($long_url);
    return $short_url;
}
add_filter('tweet_blog_post_url', 'my_short_url')
aktt_do_tweet (filter)

Returning false in this hook will prevent a tweet from being sent. One parameter is sent, the Tweet object to be sent to Twitter.

Example psuedo-code:

function dont_tweet($tweet) {
    if (some condition) {
        // will not tweet
        return false;
    }
    else {
        // must return the $tweet to send it
        return $tweet;
    }
}
add_filter('aktt_do_tweet', 'dont_tweet')
aktt_do_blog_post_tweet (filter)

Returning false in this hook will prevent a blog post Tweet from being sent. Two parameters are passed, the Tweet object to be sent to Twitter and the Post generating the Tweet.

Example psuedo-code:

function dont_post_tweet($tweet, $post) {
    if (some condition) {
        // will not tweet
        return false;
    }
    else {
        // must return the $tweet to send it
        return $tweet;
    }
}
add_filter('aktt_do_blog_post_tweet', 'dont_post_tweet', 10, 2)
aktt_do_tweet_post (filter)

Returning false in this hook will prevent a blog post from being created from a Tweet. Two parameters are passed, the data to be used in the post and the Tweet object.

Example psuedo-code:

function dont_tweet_post($post, $data) {
    if (some condition) {
        // will not post
        return false;
    }
    else {
        // must return the $data for a post to be created
        return $data;
    }
}
add_filter('aktt_do_tweet_post', 'dont_tweet_post', 10, 2)
aktt_tweets_to_digest_post (filter)

Allows you to make changes the tweets that will be included in a digest post.

aktt_options_form (action)

Allows you to add to the Twitter Tools settings page.

aktt_post_options (action)

Allows you to add to the Twitter Tools box on the New Post page (requires the option to tweet on blog posts to be enabled).

Known Issues

  • If you change your blog post notification tweet prefix, the previous blog post notification might not be correctly recognized as a blog post tweet. This is only under very rare conditions due to timing issues.
  • Only one Twitter account is supported (not one account per author).
  • Tweets are not deleted from the tweet table in your WordPress database when they are deleted from Twitter. To delete from your WordPress database, use a database admin tool like phpMyAdmin.

Download

FYI

Compatibility beta

Your Setup

Log in to vote.

The Consensus (17 reporting)

76%
100,1,1
76,17,13
100,2,2

Average Rating

5 stars
4 stars
3 stars
2 stars
1 star
(102 ratings)