Using alternative URL shorteners with Twitter Notify plugin

14Jan09

Hopefully, folks who use both Windows Live Writer and Twitter know about the Twitter Notify plugin we released in December. Out of the box, it uses the venerable (but still awesome) TinyURL service to shorten the URL to your blog post.

However, if you prefer a different URL shortening service, like is.gd or snipr, you might be able to get the plugin to use that instead, with a simple registry tweak.

The plugin will replace {0} or {1} with the URL of your post. ({0} will just drop the URL in, while {1} will URL-encode the URL first. The latter seems more correct, but TinyURL and is.gd both expect the former.) Then it will make a web request to the resulting URL, and assume that the entire response is the shortened URL.

Not all URL shortening services will work. For example, bit.ly has an API but it returns JSON or XML, not just the bare URL, so at best you’ll get a bunch of garbage in the post. Update April 1, 2010: See comment below by Max for bit.ly instructions.

You can also choose to skip the shortening step and just put the whole URL in there; just create the UrlShortener string value but leave it empty.

Hm. The version I had was from Live Gallery, but I uninstalled it and installed the one above just in case. It’s still not quite behaving as you describe it should; I have to actually deselect the plugin from the last blog I used it with (I have four), close Live Writer, reopen it and reselect the plugin before publishing the next post in order to get Writer to execute the plugin and give me the signin popup. If I don’t do all that it says it’s executing the plugin, but it doesn’t give me the popup and Twitter doesn’t get updated. I’m using Vista Ultimate 64bit, fwiw. Thanks for the help, though.

3) If this post has already been published, have we already successfully tweeted? If so, don’t show.

4) If this post has already been published, have we already shown the user the plugin UI and they hit Cancel? If so, don’t show, because I guess they don’t want to tweet about this post.

5) Is this post currently being published as a draft? If so, don’t show.

(It may seem that #3 and #4 just mean “if we’ve shown the Twitter plugin UI before, don’t show” but actually, if the user tried to submit a tweet but it failed due to e.g. Twitter being down, then that doesn’t count.)

If you make sure #1 and #2 are enabled, then publish a new post, and it still doesn’t show the UI, then it sounds like a bug–let me know.

4) If this post has already been published, have we already shown the user the plugin UI and they hit Cancel? If so, don’t show, because I guess they don’t want to tweet about this post.

Ah, I think this might be what’s throwing it. I do hit cancel if I want to tweet about a different blog, and that’s usually when the trouble starts. Notify then seems to get the idea that I don’t want to tweet about anything in that same session, new posts included, ending with me having to close and reopen writer. Thanks.

Hi there, can you please email me back and tell me if its possible for me to write a plug in that will get activated when the user selected an inserted picture within the post so that my plunging can modify it?

Sorry about the off-topic question. I’m actually looking for the Insert Horizontal Rule plugin. I see some reference on Google which points to something you posted to a MSN Group which doesn’t exist any more. Is it possible to add that plugin to the Writer Plugin Gallery?