How to use StumbleUpon’s su.pr URL shortener in leenk.me

I recently wrote about using the bit.ly URL shortener in leenk.me and was doing some research into adding the StumbleUpon social sharing site to the leenk.me plugin. However, I was saddened to find that StumbleUpon does not have a public API. So there isn't a way to publicize your posts directly to StumbleUpon, like you can with Facebook, Twitter, etc.

However, StumbleUpon does have a URL shortener called Su.pr. The su.pr URL shortener is basically like adding your site to StumbleUpon... it's the only way leenk.me can use the service. So if you want people to be able to "Stumble Upon" your site, try this code:

function custom_leenkme_url_shortener( $api_url, $url ) {

    $supr_api ="http://su.pr/api/simpleshorten";

    $supr_args = array(
                            'url' => $url
                        );

    return $supr_api . '?' .  http_build_query( $supr_args );

}
add_filter( 'leenkme_url_shortener', 'custom_leenkme_url_shortener', 10, 2 );

Or, if you want to track your Stumbles, you can sign up at su.pr and use this code:

function custom_leenkme_url_shortener( $api_url, $url ) {

    $supr_api ="http://su.pr/api/simpleshorten";

    $supr_args = array(
                            'url' => $url,
                            'login' => 'ENTER_YOUR_SUPR_NAME',
                            'apiKey' => 'ENTER_YOUR_SUPR_APIKEY'
                        );

    return $supr_api . '?' .  http_build_query( $supr_args );

}
add_filter( 'leenkme_url_shortener', 'custom_leenkme_url_shortener', 10, 2 );
This entry was posted in Custom URL Shorteners, News. Bookmark the permalink.


9 Responses to How to use StumbleUpon’s su.pr URL shortener in leenk.me

  1. Pingback: 3dgamer

  2. Pingback: Joseph

  3. Pingback: Joseph

  4. Pingback: Joseph