Some guys asked me how I did with the Tweetmeme button which using the Su.pr URL shortener. Su.pr is a service of Stumbleupon, a very popular social network, which helps people share the web content together. It’s pretty easy to integrate Tweetmeme and Su.pr and this is how I did.
Like the article? Be sure to subscribe to our RSS feed and follow us on Twitter to stay up on recent content.
You can use Tweetmeme with: bit.ly (very popular), awe.sm… but I think the best choice for your blog is Su.pr. With Su.pr shortener, your short links will have an useful top sharing bar which users can vote(give thumb-ups) and add reviews to your links. The more thumb-ups your link got, more popular your link will be on StumbleUpon.
Integrating Su.pr URL shortener to Tweetmeme button is really easy. You might don’t care about this, but if you give it a try, you can gain more (I mean a lot) of traffic from Stumbleupon.
This is how Tweetmeme button works (I’m not talking about Tweetmeme plugin for WordPress):
<script type="text/javascript"> tweetmeme_service = 'bit.ly'; </script> <script type="text/javasrcipt" src="http://tweetmeme.com/i/scripts/button.js"></script>
However, if you are using the URL shortener that supports only with API, you need to request the service API key(Su.pr is a API support URL shortener).
1- Get the Su.pr API key:
Login to http://su.pr with your Stumbleupon account. Then navigate to the Settings page to get your API key(already generated by default):

2- Customize the Tweetmeme button:
After you got your key for API using, you will need to customize the Tweetmeme button which requires the service name and service API to generate short URL for Su.pr.
The complete code to make Tweetmeme works with Su.pr URL shortener is (WordPress version):
<script type="text/javascript"> tweetmeme_url = '<?php the_permalink() ?>'; tweetmeme_source = '[You Twitter ID is here if you want to]'; tweetmeme_service = 'su.pr'; tweetmeme_service_api = '[your API key is here]'; </script> <script type="text/javascript" src="http://tweetmeme.com/i/scripts/button.js"></script>
Result:
It’s quite easy, right? From now on, your re-tweet button will use the Su.pr URL shortener to get more traffic from Stumbleupon. Maybe you don’t like the top share bar in your short URL but the more thumb-ups, more popular your link will be. You make a call!
Updated: For whom using Tweetmeme plugin for WordPress(thanks David ), add this code to tweetmeme.php file (below of line 337):
<option <?php if (get_option('tm_url_shortner') == 'su.pr') echo 'selected="selected"'; ?> value="su.pr">su.pr</option>
Then enter your API key in the field – ‘URL Shortener API Key’ on the settings page.
Note: if you update the plugin, this may need to be added again…



Such a very useful work Thanks for the posting…..
Great way for making traffic
It’s really fantastic, thank for sharing it
Nice.Thanks for the share.
I assume this is using Tweememe without a plugin ?
If you using a plugin I guess you have to alter the plugin code ?
Nice tips.
After a quick look, amend the Tweetmeme plugin to adapt this just add this -
<option value=”su.pr”>su.pr
Below line 337 in the Tweetmeme.php file.
Then enter your API key in the field – ‘URL Shortener API Key’ on the settings page.
UPDATE: Cant C&P PHP into comments here….dang
You can convert all html code to entity html then put in the comment or just shoot me an email. I will update this post includes your code. Cheer!
Thank Lam for this. Implemented on my blog and its working perfect. Thumbs Up!
Great and useful info Lam, I will implement on my blog soon. thanks!
Will this work with Blogger?
Just change the URL of the article link!
Wow. I will try it.
Thanks Lam, very good job.
Hey Lam, this is a quality and a much needed tip.. thanks a bunch. However, I use the Tweetmeme Plugin and I am waiting for Cookie Labs’ email so that you can add that part here…
Thanks bro!
I updated the code with David’s help (see comment above!). Hope you like it, Richie!
don’t understand where’s the connection between an URL shortener and stumbleupon.
Is sharing on stumbleupon and tweeting in the same time?
that is a great tweak
Pure genius! Never thought of this!
Oke I Try it
Thanks Lam for the quick tip. I am off to set this up on my blog
I get an error.
Failed to resolve the url of the tweet.
Any ideas?
Thanks