Title: [Plugin: Sociable] Patch to support bit.ly
Last modified: August 19, 2016

---

# [Plugin: Sociable] Patch to support bit.ly

 *  [isra17](https://wordpress.org/support/users/isra17/)
 * (@isra17)
 * [16 years, 2 months ago](https://wordpress.org/support/topic/plugin-sociable-path-to-support-bitly/)
 * Hey,
    I’m here to share some code I wrote today. Sociable only supports awe.sm
   at the moment. I wanted to use an url shortener like bit.ly, so I hacked into
   the core of the plugin to support more url shortener. At the moment, I support
   bit.ly with an API key. Feel free to request more url shorteners. You can find
   the patch and the [new files there](http://alecto.free-h.net/blog/wp-content/uploads/2010/03/sociable_bitly.zip).

Viewing 13 replies - 1 through 13 (of 13 total)

 *  [delugeia](https://wordpress.org/support/users/delugeia/)
 * (@delugeia)
 * [16 years, 1 month ago](https://wordpress.org/support/topic/plugin-sociable-path-to-support-bitly/#post-1436105)
 * I downloaded the zip file, but unfortunately the bit.ly.php file is empty, zero
   length.
 *  Thread Starter [isra17](https://wordpress.org/support/users/isra17/)
 * (@isra17)
 * [16 years, 1 month ago](https://wordpress.org/support/topic/plugin-sociable-path-to-support-bitly/#post-1436109)
 * Thank you to report this bug. This is really strange because on the FTP the file
   is fine, but when I download it the bitly.php is empty :/.
    Anyway, I put the
   file outside from wordpress folder and it work. Get [it here](http://alecto.free-h.net/data/sociable_bitly.zip).
 *  [phattrance](https://wordpress.org/support/users/phattrance/)
 * (@phattrance)
 * [16 years ago](https://wordpress.org/support/topic/plugin-sociable-path-to-support-bitly/#post-1436123)
 * thank you, it works great now!
 *  [hearmegrrl](https://wordpress.org/support/users/hearmegrrl/)
 * (@hearmegrrl)
 * [16 years ago](https://wordpress.org/support/topic/plugin-sociable-path-to-support-bitly/#post-1436130)
 * Hi, I implemented these files (copied them into the sociable dir), and then edited
   the sociable settings to select bit.ly and put in my bit.ly username and API 
   key. However, nothing is any different on the blog…when I click on the Twitter
   icon for example, the URL is the same and does not shorten. Am I missing a step?
 *  [hearmegrrl](https://wordpress.org/support/users/hearmegrrl/)
 * (@hearmegrrl)
 * [16 years ago](https://wordpress.org/support/topic/plugin-sociable-path-to-support-bitly/#post-1436131)
 * Actually, nevermind, I got it to show up on the page…BUT, when I click the link
   and it takes me to the bit.ly.php page to translate the link, it just displays
   a blank page and doesn’t ever translate/resolve to the social network site. Here’s
   a sample:
 * [http://silverpopstaging.beacontec.com/blogs/test1/wp-content/plugins/sociable/bit.ly.php?u=http://twitter.com/home?status=This%20is%20a%20Test%20-%20PERMALINK&t=http%3A%2F%2Fsilverpopstaging.beacontec.com%2Fblogs%2Ftest1%2Funcategorized%2Fthis-is-a-test.html](http://silverpopstaging.beacontec.com/blogs/test1/wp-content/plugins/sociable/bit.ly.php?u=http://twitter.com/home?status=This%20is%20a%20Test%20-%20PERMALINK&t=http%3A%2F%2Fsilverpopstaging.beacontec.com%2Fblogs%2Ftest1%2Funcategorized%2Fthis-is-a-test.html)
 *  [archetypemkt](https://wordpress.org/support/users/archetypemkt/)
 * (@archetypemkt)
 * [16 years ago](https://wordpress.org/support/topic/plugin-sociable-path-to-support-bitly/#post-1436137)
 * I can’t get this patch to work. Has anyone been able to get it to work? I have
   the same issues as hearmegrrl with the long links that lead back to an error 
   page on my blog.
 *  [Baden](https://wordpress.org/support/users/baden03/)
 * (@baden03)
 * [15 years, 10 months ago](https://wordpress.org/support/topic/plugin-sociable-path-to-support-bitly/#post-1436145)
 * [@isra17](https://wordpress.org/support/users/isra17/) – Great patch! Worked 
   like a charm
    [@archetypemkt](https://wordpress.org/support/users/archetypemkt/)–
   verify that you did the following: 1. copy the contents of the .zip file into
   the sociable folder 2. verify the sociable plugin is activated 3. from the wp
   dashboard: options > sociable make sure that: a) Url shortener: as bit.ly radio
   button checked b) bit.ly login: enter your bit.ly username c) bit.ly API Key:
   enter your bit.ly API Key 4. Save changes
 *  [apronstringsaflutter](https://wordpress.org/support/users/apronstringsaflutter/)
 * (@apronstringsaflutter)
 * [15 years, 6 months ago](https://wordpress.org/support/topic/plugin-sociable-path-to-support-bitly/#post-1436161)
 * This worked great for me, thanks! One question. Is there a way to add “Im reading…”
   before the actual post name and shortened URL that results in the tweet? If so,
   where would I add that? Im PHP challenged…
 *  Thread Starter [isra17](https://wordpress.org/support/users/isra17/)
 * (@isra17)
 * [15 years, 4 months ago](https://wordpress.org/support/topic/plugin-sociable-path-to-support-bitly/#post-1436169)
 * If this isnt working you should make sure that you followed Baden step. I updated
   the patch today because I just found out that wordpress where using its own custom
   magic_quote function and when you were trying to use ‘,” or \ in your title they
   were escaped. Only bit.ly.php has changed.
 * [@apronstringsaflutter](https://wordpress.org/support/users/apronstringsaflutter/)–
   You can ‘hack’ through sociable.php in sociable plugin folder and change line
   540 into something like
    `'url' => 'http://twitter.com/home?status=I%27m%20reading...%
   20TITLE%20-%20PERMALINK',`
 * I hope this might help you
 *  anonymized-7699968
 * (@anonymized-7699968)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/plugin-sociable-path-to-support-bitly/#post-1436177)
 * Patch works just fine with the exception of one detail – while URLs are shortened,
   neither Facebook, nor Delicious fetches info like post title. As a result, when
   sharing through Facebook, bit.ly URL is used as both URL and title, the same 
   goes for Delicious.
 * Twitter works great, with certain changes I made:
    `'url' => 'http://twitter.
   com/home?status=TITLE%20|%20BLOGNAME|%20PERMALINK',`
 * On the other hand, similar changes made to Facebook do not work, post title and
   blog name are not posted to Facebook:
    `'url' => 'http://www.facebook.com/share.
   php?u=PERMALINK&t=TITLE%20|%20BLOGNAME',`
 * It all worked without the bit.ly patch.
 *  Thread Starter [isra17](https://wordpress.org/support/users/isra17/)
 * (@isra17)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/plugin-sociable-path-to-support-bitly/#post-1436178)
 * I didnt change anything in the url list, but you should try to replace the **‘&’**
   by **‘&’** like others URL.
    Original version (note the **&**)`'url' => 'http://
   www.facebook.com/share.php?u=PERMALINK&t=TITLE',` this should look like `'url'
   => 'http://www.facebook.com/share.php?u=PERMALINK&t=TITLE%20|%20BLOGNAME',` hope
   this help
 * Edit: Nevermind, look like & amp; are converted to & by wordpress.
 * Edit 2: Found why it happens. This is dumb (I’m using ‘t’ to pass the link throught
   the bit.ly script but page like facebook use ‘t’ too so its not working well.
   I will fix it asap.
 *  Thread Starter [isra17](https://wordpress.org/support/users/isra17/)
 * (@isra17)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/plugin-sociable-path-to-support-bitly/#post-1436179)
 * I did some change. I’m not using facebook tho, so I can’t test if it work now,
   but I think it should. New version here : [http://alecto.free-h.net/blog/wp-content/uploads/2011/03/sociable_bitly.zip](http://alecto.free-h.net/blog/wp-content/uploads/2011/03/sociable_bitly.zip)
 *  anonymized-7699968
 * (@anonymized-7699968)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/plugin-sociable-path-to-support-bitly/#post-1436180)
 * Great, I confirm Facebook, Twitter and Delicious working just fine. Thanks a 
   lot for a quick reaction!

Viewing 13 replies - 1 through 13 (of 13 total)

The topic ‘[Plugin: Sociable] Patch to support bit.ly’ is closed to new replies.

## Tags

 * [bit.ly](https://wordpress.org/support/topic-tag/bit-ly/)

 * 13 replies
 * 8 participants
 * Last reply from: anonymized-7699968
 * Last activity: [15 years, 2 months ago](https://wordpress.org/support/topic/plugin-sociable-path-to-support-bitly/#post-1436180)
 * Status: not a support question

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
