Posting to Twitter with Launchy

[UPDATE2]

This tool has been deprecated. I leave the download links as they are, but if you want to interact with Twitter from within Launchy you better check out updated version of this tool here.

[UPDATE]

I uploaded a binary version of the tool, for those who don’t want/can’t deal with source code.

Grab it here.

I’ve been using Twitter for few days now, and I’ve tried quite a few options to use it. Currently I’ve settled on three different ways of interaction with the services (excluding browsing its website)

  • When I’m in Firefox I use TwitterBar extension, that allows me to write posts in my address bar.
  • When I read posts (tweets?) of other users in Twihrl and I want to comment on them, I use Twihrl to post.
  • When I’m just doing something on my computer and I want to post without running Firefox or Twihrl I use my beloved app launcher – Launchy to post.

This last option is a little bit tricky and it required a little bit of work to set up. I assume you have Launchy already installed. If not, go get it here.

You’ll also need Twitt.Poster that we’ll be invoking from Launchy to do actual work for us. Just compile the project, set your username and password in app.config, and put the compiled files in some directory.

Next, open Launchy, right-click it, and select “Options”. Then navigate to “Plugins” tab, and select “Runny”. This is the plugin, that will invoke Twitt.Poster.

To make it do so, click the ‘+’ button at the bottom and add new entry to the grid. Name is the name of the command in Launchy – “twitt” in my example but you can call it whatever you like. Then Program is the fully qualified path to the executable of the poster application. Last column is command line arguments and you should set it to “$$”. Notice that you need to put dollar sings in quotation marks, otherwise it won’t work. When you’re done just click OK, and we’re all set.

launchy_twitter

Now you can invoke the command in Launchy, press tab, and enter your message. When you’re done just press enter and your message should get posted to Twitter.

launchy_twitter2

That’s it. So far this is my favorite way of posting to Twitter.

As for Twitter.Poster, use it however you like and don’t sue me if it breaks something. I publish it on terms of BSD licence. However, it uses Twitterizer library, that is licensed under terms of GPL v3, so take that into account when creating derivative work.

This is just a sample application that I created mostly for myself. However you can post bugs and feature requests in comments. I don’t want to promise anything, but I may implement some of them if there’s demand and I find some time.

Technorati Tags: ,
  • Ricky Smith

    Thanks for using the Twitterizer library! Great idea using launchy, I’m excited to start using Twitt.Poster.

    FYI: I’ve updated the license to use the New BSD license. Have fun!

  • Ricky Smith

    By the way, you don’t need to copy the twitterizer classes into your project. Instead, build the Twitterizer.Framework project and use the .dll it builds as a reference in your project.

    Also, using the current version of twitterizer (r34) here’s a fixed “Main” method in Program.cs:

    static void Main(string[] args)
    {
    Application.EnableVisualStyles();
    Application.SetCompatibleTextRenderingDefault(false);
    if (args.Length != 1 || string.IsNullOrEmpty(args[0]))
    return;

    var text = args[0];
    if (text.Length > 140)
    MessageBox.Show(String.Format(messageTextTooLong, text.Length), errorHeader);

    try
    {
    new Twitter(ConfigurationManager.AppSettings[“user”], ConfigurationManager.AppSettings[“pass”]).Status.Update(text);
    }
    catch (Exception e)
    {
    MessageBox.Show(string.Format(errorMessage, e.Message), errorHeader);
    }

    }

  • Ricky,
    I didn’t really want to drag another .dll with the app, or use IlMerge for something so simple. This is a proof of concept, rather than production quality code. If there’s a demand to improve it, I actually might some day (like do it the ‘right way’, as an actual plug-in to Launchy).

  • Ricky Smith

    No problems. I just wanted to make sure you knew you could do it that way. I’m not pushy about it. 🙂

    By the way, I’ve been using Twitt.Poster and it works great and saves a ton of time!

  • David Van

    Downloaded the zip file and followed all the steps to set up Runny but did not find a Twitter.Poster.exe file in the zip package. There is a Twitter.Poster.csproj file. Any advice? Thanks in advance.

  • Hi David.
    So far I only uploaded source code version. If you don’t want to compile it yourself grab this: cid-6e18e107780d3f4a.skydrive.live.com/…/Twit…
    this is a binary version (ie Twitt.Poster.exe)
    Have fun.

  • mehdi

    Hi, thanks for useful article. I did your instructions exactly as above article, i installed latest version Launchy, compile your app source within VS2008 Express Edition and then i add the path as a new plugin to launchy, i also provided my user/pass within config file. Every thing looks fine but no post appears on my twitter page. i tried many times but no change. Do you have any idea about the problem?

    Thanks in advance
    mehdi

  • @Mehdi
    One thing I can think of from the top of my head:
    Do you have a space character in your path? If that is the case, it may be the reason why Launchy is not picking up the poster app.

  • mehdi

    Dear Krzysztof
    It was my fault not the space in my path or any thing else, your solution worked perfect. I was addressed wrong executable.
    Twitt.Poster solved my other problem too. i was using “curl” for twitting and it couldnt post in Unicode but Poster solved it.

    Thanks again
    Mehdi

  • mehdi

    Dear Krzysztof
    when i try to twitt i receive this error:
    “Twitter error: The remote server returned an error: (411)Length Required..”
    i was twitting for a few days with no errors, then what causes this error?

    Thanks
    Mehdi

  • Mehdi,
    No idea what might be the cause. I just checked, and for me it works perfectly fine. Does it happen everytime you twitt?

  • Deepak

    Hello,

    Can any one help me in creating account with twitter using twitter API. I want to add this functionality in my application that new user can create their account on twitter from my own UI.

    Thanks

  • Tom

    Just thought of the idea of updating via Launchy, glad to see that you have made this possible. The Binary version was a huge time saver too.

  • Ted

    This is an interesting concept. What are your thoughts on a standalone launchy like application for Twitter like samuelhaddad.com/software-projects/twittertalk/ for people who don’t use launchy?

  • Ryan

    Would love to Tweet from Launchy but I can’t seem to download the binary tool. The download link doesn’t seem to work and I have no idea how to compile it myself.

  • Ryan

    Haha, well I found the download link in the comments that worked. Followed your instructions and my tweets are showing up on Twitter. But, after every tweet I get an error about being unable to parse Twitter response. Anything you might suggest I check?

  • That’s probably some change in the Twitter API.

    I would have to update to the newest version of Twitterizer.
    I’ll take a look later today

  • That’s a great way to posting to twitter, thanks