Posts Tagged ‘tweet’

Free “Tweet This” Buttons For Your Homepage

Wednesday, May 6th, 2009

It’s a bit funny. When I wrote the articles regarding how to create “Tweet This” buttons with PHP and with JavaScript I was pretty sure that I had already created “Tweet This” buttons for your homepage but in fact I simply had forgotten it.

So I have just created some new buttons just for that purpose. You can download the full package below for free. As always I’d appreciate a link back to this page but this is not required.

Just follow the instructions in the articles linked above. A working JavaScript demo is included in the download.

These are the images that are contained in this package:

Tweet This Buttons

Tweet This Buttons

downloadnow-free

If you like the graphics included in the package I’d appreciate if you’d retweet it by clicking on the “Tweet This” button below. Download the full package with many more graphics here.

tweetthis-15

How To Create A Dynamic “Tweet This” Button With JavaScript

Wednesday, May 6th, 2009

Yesterday I posted some code on how to create dynamic Tweet This buttons with PHP, today I’m going to share a short code snippet you can really drag and drop into your editor to create a “Tweet This” button on your website.

You just need to copy and paste this code and adjust the src attribute of the image to point to your button:

<script type="text/javascript">
var twtTitle  = document.title;
var twtUrl    = location.href;
var maxLength = 140 - (twtUrl.length + 1);
if (twtTitle.length > maxLength) {
twtTitle = twtTitle.substr(0, (maxLength - 3))+'...';
}
var twtLink = 'http://twitter.com/home?status='+encodeURIComponent(twtTitle + ' ' + twtUrl);
document.write('<a href="'+twtLink+'" target="_blank"'+'><img src="tweetthis.gif"  border="0" alt="Tweet This!" /'+'><'+'/a>');
</script>

tweetthis-15

How To Create A Dynamic “Tweet This Button” With PHP

Tuesday, May 5th, 2009

Yesterday I have just released some of my graphics for Twitter that I have designed myself.

This time I will show you how can easily create links to your own pages on your website or different articles whenever you have both a page URL and a page title available.
This code automatically removes characters from the end of the title so that in addition to the URL itself and a space character between the maximum length of 140 characters will not be exceeded. If the title is too long it will be truncated and three dots will be appended to show that it has been shortened.

When clicking on the link the user is taken to the Twitter homepage with the message already preset so that he can tweet it immediately with just a single click.

function getTweetUrl($url, $title)
{
$maxTitleLength = 140 - (strlen($url)+1);
if (strlen($title) > $maxTitleLength) {
$title = substr($title, 0, ($maxTitleLength-3)).'...';
}
$output = "$title $url";
return 'http://twitter.com/home?status='.urlencode($output);
}
?>
Example usage:
<a href="<?php echo $url; ?>" target="_blank"><img src="tweetthis.gif" border="0" alt="Tweet This!" /></a>

tweetthis-15

Get More Followers - tweet.ms Bar Now Publicly Available

Tuesday, April 28th, 2009

I have just released the new tweet.ms bar. tweet.ms already allows you to create short URLs which redirect to the target page. Now you can also select to add a tweet.ms bar to your link as well which will result in the link page being displayed under the bar (if the result page has no frame breaker that is).

Now anyone who likes your shared link can directly follow you on Twitter by entering his user name and password in the bar. The user will then follow you immediately. Furthermore not only is the Twitter user name and the password never stored on the tweet.ms servers but the user can actually opt in to have an encrypted cookie stored on his PC that contains his Twitter user name and password so that he can use the tweet.ms service easily by being logged in yet never has to enter his credentials again. And his login data is stored only on the local PC - never on the server itself.

Of course the user can also retweet the message directly from within the bar or share the (original) link via various social bookmark services like del.icio.us, digg and so on.

Just see for yourself and try it out - I’m sure you’ll like it:

http://tweet.ms/6n

Comments and feedback are always appreciated - I like to hear from you.

tweetthis-15