Archive for the ‘Twitter Wordpress’ Category



Blog DIY – How to Add Hashtags to Your Blog RSS Feed Tweets!

March 1st, 2010

hashtags

Adding hashtags to your tweets can certainly enhance the chances of your tweets being spread further into the Twittersphere.  If you have a blog and you are using tools like TwitterFeed or a wordpress plug-in, chances are that your blog tweets aren’t getting the full hashtag exposure it can have.

Google has introduced a new “Socialize” section along with ability to add hash tags to your blog tweets.  Not only that, there’s an “inline hash tag” mode which will automatically turn important keywords of your blog post title into hashtags.

Plus, Google Feedburner will automatically cut off enough characters so there’s room for retweets.

These simple features make Google Feedburner a great way to get your blog tweets “enhanced” with hashtags.

Wordpress Twitter Hack – How to Make “ReTweet This!” Button using your Favorite URL Shortener!

May 8th, 2009

For those of you who want to create your own “ReTweet This!” button using your favorite URL shortener, (mine is U2S.Me, which I made from scratch) you can easily implement a CURL into your single.php to make this happen on the fly.

Here’s how to do it, add the following code in your single.php (This example uses U2S.Me to shorten URLs, you can easily change the 1st line of the PHP to fit TinyURL API or any other URL shortener you like but yes, do feel free to use mine, as it’s free!)

*Place the code where you want your ReTweet This! button to appear, I’ve placed before my content so Twitters can see it if they come to my site.

<div class=”retweet snap_noshot”>
<?php
$newurl=exec(’curl “http://u2s.me/api.php?url=’.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'].’”‘);
$ttitle = get_the_title();
if(strlen($ttitle>110)) {
$ttitle = substr($ttitle, 0,110);
$ttitle .=’…’;
}
$ttitle .=’ ‘;
$turl = ‘http://twitter.com/home?status=’.$ttitle.$newurl;
echo ‘<a target=”_blank” href=”‘.$turl.’”>ReTweet This!</a>’;
?>
</div>

Now, this will basically execute CURL command to get the shortened URL back from U2S.Me, a URL shortening I made couple hours earlier in about couple hours.

You’ve probably noticed other codes that do something like http://myblog.com/p?=112 and this isn’t really great for SEO, shortening your URL first through a URL shortening service lets you preserve your SEO-friendly URL such as http://myblog.com/mycategory/myblogpost.

Here’s a sample Tweet created from the code:

The nuclear doorbell http://u2s.me/vkb1

zedomax

Above is the button generated on Zedomax.com, now you can easily do this too by adding the CSS like this in your style.css file:
.retweet {
float:right;
height:30px;
width:110px;
text-align:center;
margin: 0 0 10px 10px;
padding: 5px 0 0 0;
border:1px solid #0018ff;
background: #0018ff;
-moz-border-radius: 5px;
-khtml-border-radius: 5px;
-webkit-border-radius: 5px;
border-radius: 5px;
}
.retweet a {
color:#fff;
text-decoration:none;
}

Please ignore “snap_noshot” tag in my code, that’s if you are using Snap.com to advertise but don’t want Snap to show up on your ReTweet This! button.

I’ve borrowed some code from Drew at Dev-Tips.com, thanks! (He also has an example for a Wordpress plugin using TinyURL, slightly different method than mine but works too.)