Popular Twitter plugin inserts "Tweet This" links so your readers can share posts with one click. Automatically tweets new posts via OAuth.
WordPress 2.7, PHP 5.0.0, and Curl. Read the Installation section for details.
Go to Settings > Tweet This, click "Advanced Options," check "Hide Tweet This block on pages," and click "Save Options."
Go to Settings > Tweet This, click "Advanced Options," check "Hide Tweet This block on all feeds," and click "Save Options."
Go to Settings > Tweet This, click "Advanced Options," check "Insert Tweet This block before content," uncheck "Insert Tweet This block after content" (unless you want the links appearing in both places), and click "Save Options."
Yes, on WordPress 2.8 or later a Twitter Updates widget is available, which functions like the Wickett Twitter Widget plugin by Automattic Inc.
Register for Twitter OAuth and enter your application keys in Settings > Tweet This > Automatic Tweeting. There are also instructions there. Then, look for the box titled Tweet This on the Write Post screen and check "Send to Twitter." If you want this enabled by default, check "'Send to Twitter' defaults to checked on unpublished posts" in Settings > Tweet This > Automatic Tweeting.
Make sure you have entered your OAuth keys correctly. Click "Test Twitter OAuth" in Settings > Tweet This > Automatic Tweeting to verify. On your Twitter application settings, "Default Access type" must be set to "Read & Write." Also, make sure you have checked "Send to Twitter" on the Write Post screen.
After you enter your OAuth keys, a new submenu titled "Write Tweet" will appear
under the Pages menu. From this page, you can not only write tweets, but
schedule future tweets to a MySQL table wp_tweet_this_scheduled. URLs
entered here are automatically shortened if the tweet text exceeds 140
characters. A preview function is included, and you can see a list of up to 100
of your latest scheduled tweets.
The schedule tweet function on the Write Tweet page adds a row to the
wp_tweet_this_scheduled
MySQL table with the scheduled date, the tweet text,
and the status set to "future". When the first tweet is scheduled, an option is
added to the wp_options table titled tweet_this_last_cron with the value of
(time() - 86400). On every page load, (time() - 600) is compared to this
option; if it is greater, it has been more than ten minutes since the last
scheduled tweets were processed, so tweet_this_init attempts to publish all
the tweets with a status of "future" and a scheduled date in the past. If this
succeeds, the tweet's status is set to "publish"; if it fails, it is set to
"fail". Scheduled tweeting requires that someone actually visits your blog
after the scheduled date. The scheduled tweet is not triggered until a page is
loaded. Automatic tweets on scheduled posts are much simpler: the function to
publish the tweet is simply attached to the publish_post hook.
Web links are what Tweet This has always used. They take the form http://twitter.com/intent/tweet?text=Your+message and will display "via web" when tweeted. Share links are like http://bit.ly/asEAtj (long URL) and use the same API as the official Tweet button, but as a regular link instead of a JavaScript popup. They use Twitter's official URL shortener, T.co, allow you to specify up to two related users to be suggested after the tweet is made, and will display "via Tweet Button" when tweeted.
Cached short URLs are saved to the postmeta table when a visitor views posts. For any future pageloads, those URLs are loaded, instead of contacting Bit.ly or TinyURL again. As long as the post's permalink doesn't change, the short URL from the third-party service doesn't change.
The cache is invalidated by setting the existing short URLs in the postmeta
table to "getnew" as needed. By reusing the old fields instead of replacing
them, I don't bump up the meta_id counter needlessly. When the next person
visits that post, the get_tweet_this_short_url function in Tweet This
sees this and gets a new short URL.
What triggers a cached URL as invalid? When you save a post (including editing and publishing), the cache is invalidated in case you changed the permalink. Secondly, when you change URL services under Settings > Tweet This or change permalink structures under Options > Permalinks, all the cached URLs are set to "getnew". Finally, if you change "Use 'www.' instead of 'http://' in shortened URLs" or "Don't shorten URLs under 30 characters," or import new settings, the cache is invalidated. If you move your blog to a different directory or domain name, click the "Flush URL Cache" button in the options.
When you deactivate the plugin, all the cached URLs are deleted.
In the options menu, there is a section titled "Import / Export Options." This
is as simple as can be: the export is a raw dump of the tweet_this_settings
row from the wp_options table, and to import, you just paste that dump in the
import text area. Click "Import Options," and your current options will be
replaced. Your OAuth keys are included, so don't share it with anyone.
You enter the API's path with [LONGURL] as the long URL. For TinyURL, for example, you would enter "http://tinyurl.com/api-create.php?url=[LONGURL]". Then Tweet This uses that service for all its short URLs. The API must accept HTTP GET requests (not POST), and it must output a plain-text short URL (no HTML, XML, or arrays) with the http prefix.
One of the options for the Twitter icon in the Tweet This Options is "Editable text box." This gives your readers a text box with character counter so they can change the tweet on your site before going to Twitter. When you click the submit button, an interstitial is loaded which parses and sends the new tweet text, forwarding the reader to Twitter. Then it is the same as the regular options: the reader can edit the tweet further on Twitter, or submit.
Tweet This ships with the file named as tt-config-sample.php. This way,
if you rename it to tt-config.php to use it, you can still upload future
versions of Tweet This right over the old directory, because your customized
tt-config.php file will not be overwritten. Once you rename it, there are
several options you can set in it that are too advanced or cannot be included
in the regular options menu. Note that you WordPress automatic upgrade will
always delete tt-config.php.
Yes. Within the loop, these functions are available:
tweet_this_manual() : Echoes all the Tweet This links and disables regular
output. Useful for moving the Tweet This links above each post. If you want to
insert Tweet This below where it is normally inserted, you must add the line
"remove_filter('the_content', 'insert_tweet_this');" before this function.
tweet_this($service, $tweet_text, $link_text, $title_text, $icon_file,
$a_class, $img_class, $img_alt) : Echoes a Tweet This link. This is only
useful if you disable automatic insertion in the settings. You can leave
the parameters blank like '' to use your settings from the options page.
$services can be 'twitter', 'plurk', 'buzz', etc. The $icon_file parameter is
for the filename of an image from the /tweet-this/icons/ folder. Sample usage:
tweet_this('twitter', '@richardxthripp [TITLE] [URL]', '[BLANK]',
'Share on Twitter [[URL]]', 'de/tt-twitter-big3-de.png', 'tweet-this',
'tt-image', 'Post to Twitter'). $icon_file can also be set to "noicon".
tweet_this_url($tweet_text, $service) : Echoes the Tweet This URL.
Optional tweet_text parameter overrides "Tweet Text" from the
options menu. $service can be 'twitter' or 'plurk', or omitted for Twitter.
Sample usage: tweet_this_url('@richardxthripp [TITLE] [URL]', 'twitter').
tt_shortlink() : Just echoes the short URL for the post (Local, Bit.ly,
TinyURL, etc.), cached if possible. Creates the short URL on-the-fly if needed.
tt_option($key) : like get_option(), but specifically for Tweet This
settings. Useful for retrieving settings from the database.
Sample usage: tt_option('tt_url_service'). Returns without echoing.
You can prefix these functions with get_ to return the
data without echoing, for further manipulation by PHP.
Tweet This is nearly 5000 lines of PHP and stores over 120 options in a serialized array in the wp_options table. A typical Tweet This installation uses about 1MB of RAM per WordPress instance. Even if you are not using Tweet Tweet, you should use a caching plugin such as W3 Total Cache because WordPress is a resource hog.
Yes: add a custom field titled tweet_this_hide with the value of "true".
Sure! Activate the plugin, go to Settings > Tweet This, uncheck "Insert Tweet This," and click "Save Options."
Yes. The short URLs are on third-party servers (Bit.ly, Su.pr, TinyURL, etc.), and they should never delete them. Local URLs are built into WordPress and will continue to work.
Yes: from the "Write Tweet" page under the "Pages" menu.
No. Automatic tweeting only works with one account per blog.
Yes: a complete list is displayed in the options below the Twitter icons.
No, but you can use Share Links which use Twitter's official URL shortener.
No, but you can use Bit.ly and enter your API key to get stats from Bit.ly.
Yes: at the bottom of the Extended Services section in the options, there is a comma delimited field titled "Public Display Order" to do just that.
No.
No.
Yes: in the Advanced Options section in the options, check the box titled "Use full permalinks unless Tweet/Plurk Text exceeds 140 characters."
Requires: 2.7 or higher
Compatible up to: 3.2.1
Last Updated: 2010-11-6
Downloads: 230,634




