Integrate TweetMeme Button into BlogEngine.NET

by Al Bsharah | 05.12.2009 09:03 PM | Comments (12)

UPDATE: 5/26/2010:  As you've probably noticed, I've replaced this code with a Topsy.com button.  I like the system better, and it seems much more reliable and stable.  You can apply this similarly by checking out their APIs and sample code.

UPDATE 5.13.2009:  Trying to find out why the counter is not incrementing, I know there's at least two out there...and other posts seem to work fine.

UPDATE 5.15.2009:  Appears Tweetmeme might have lost some Tweets and not aggregated them into the system, they did an upgrade and things seem to be better...  (their support response was admirably quick, too!)

Ran across a nice article on Daily Cycle called Re-Tweet Counter For BlogEngine.NET that shows how to add a TweetMeme Button to your site or blog.  This shows how many times your post has been re-tweeted, as well as allowing your readers to easily re-tweet your article.

As you can see, I’ve added the “button” to the left of the body text within each post.  As stated in the Daily Cycle post, all it takes to get up and running is a quick modification of the TweetMeme code and the PostView.aspx file in your theme.  Voila, you’re good to go.

My code is slightly different than that posted on Daily Cycle, so I’ve included it here.

<div style="float: left; padding: 10px;">
  <script type="text/javascript">
    tweetmeme_url = <%="'" %><%=Post.AbsoluteLink %><%="'" %>;
    tweetmeme_source = 'ALBsharah';
  </script>
  <script type="text/javascript" src="http://tweetmeme.com/i/scripts/button.js"></script>
</div>

You can also add the following line for a more “compact” version of the button:

tweetmeme_style = 'compact';

Enjoy… Oh, and go click the Re-Tweet button while you’re at it!

Share | | |

Comments

5/28/2009 2:59:36 AM #

tim

Hey thanks for the link. I like the way you have added your re-tweeter. I thought about doing something similar but I often have images at the start of the post so didn't want it to get in the way.

tim United Kingdom | Reply

5/28/2009 7:43:58 AM #

Al Bsharah

Thanks for posting, Tim!  Your article was great and got me rolling with the button, which I love.  

It doesn't look *too* bad with images (I do that a lot too, but with the images to the right), you can see it in some of my other articles.  It's starting, in some cases, to look a little cluttered though...but I still like it.

Cheers!

Al Bsharah | Reply

6/14/2009 10:55:58 AM #

Robin Evans

Thanks, Al. I just ran across Tweetmeme. And found your post in a search. Saved me a bit of work. I'm not yet sure if I'll keep the compact button at the top of stories where -- as you mentioned -- it can start to make things cluttered. But it's easy enough to move it later.

Robin Evans United States | Reply

6/14/2009 3:56:10 PM #

Al Bsharah

Hey Robin, thanks for commenting!  Glad you liked it, I've been very happy with how it works.  Oh, and thanks for clicking the re-tweet button...  <grin>

Al Bsharah | Reply

6/14/2009 4:46:48 PM #

Robin Evans

Sure. Always happy to retweet even though I doubt many of my followers on Twitter would even know what BlogEngine is. But hey...

BTW, one thing I've noticed is that having the button on the posts makes it really awkward to change a slug after the fact (as I sometimes do with redirects from ManagedFusion.Rewriter). TweetMeme only recognizes tweets to the current url.

Robin Evans United States | Reply

6/16/2009 6:38:07 AM #

Al Bsharah

Ahhhh, that's a good point.  I'll have to keep that in mind...

While your readers might not be familiar with BlogEngine, you might be surprised how many people talk about BlogEngine on Twitter!  I have my Google Reader pull in tweets via http://search.twitter.com/search?q=BlogEngine - I get multiple hits per day on it, and have learned about new extensions this way (i.e. this very button).

Al Bsharah | Reply

7/10/2009 9:23:53 AM #

Cars

Nice blog post and a great design, is this a custom template?

Cars United Kingdom | Reply

7/10/2009 10:22:29 AM #

Al Bsharah

Thanks for posting...  The template is based off one of the BlogEngine.NET default themes, but I modified the color scheme and added a third pane to the left (the LifeStream).  

Al Bsharah United States | Reply

10/18/2009 3:28:26 AM #

Free Blackberry Applications

Thanks for sharing the code al.. I've been looking for it

Free Blackberry Applications United States | Reply

10/25/2009 7:11:11 PM #

Miami web design

Wow.. Great post.. Thanks for the link mate.. I'm sure that all of us here are happy on this..

Miami web design United States | Reply

5/26/2010 7:34:36 AM #

Jason

How do I get the box to drop down a little further into the posting?  I used your code (changing my username, obviously) but the box pops up into the title bar instead of melding neatly into the text.

Jason United States | Reply

5/26/2010 11:48:56 AM #

Al Bsharah

Hey Jason, looks like you might have wedged the code into the wrong place?  (i.e. after your name and before the comments counter)

It needs to go right before the first character of the post body...so find that control and stick this code in front of it.  Should do the trick...

Good luck!

Al Bsharah United States | Reply

Add comment
Anything that hints of SPAM will be either caught by my filters or deleted by me, so please don't waste your time or mine.


(Will show your Gravatar icon)

  Country flag

Click to change captcha
biuquote
  • Comment
  • Preview
Loading



RecentComments

Comment RSS

Calendar

<<  July 2010  >>
MoTuWeThFrSaSu
2829301234
567891011
12131415161718
19202122232425
2627282930311
2345678

View posts in large calendar

Tag cloud