Posting to Twitter with Launchy

[UPDATE2]

This tool has been dep­re­cated. I leave the down­load links as they are, but if you want to inter­act with Twit­ter from within Launchy you bet­ter check out updated ver­sion of this tool here.

[UPDATE]

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

Grab it here.

I've been using Twit­ter for few days now, and I've tried quite a few options to use it. Cur­rently I've set­tled on three dif­fer­ent ways of inter­ac­tion with the ser­vices (exclud­ing brows­ing its website)

  • When I'm in Fire­fox I use Twit­ter­Bar exten­sion, that allows me to write posts in my address bar.
  • When I read posts (tweets?) of other users in Twihrl and I want to com­ment on them, I use Twihrl to post.
  • When I'm just doing some­thing on my com­puter and I want to post with­out run­ning Fire­fox or Twihrl I use my beloved app launcher — Launchy to post.

This last option is a lit­tle bit tricky and it required a lit­tle 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 invok­ing from Launchy to do actual work for us. Just com­pile the project, set your user­name and pass­word in app.config, and put the com­piled files in some directory.

Next, open Launchy, right-click it, and select "Options". Then nav­i­gate to "Plu­g­ins" tab, and select "Runny". This is the plu­gin, that will invoke Twitt.Poster.

To make it do so, click the '+' but­ton at the bot­tom and add new entry to the grid. Name is the name of the com­mand in Launchy — "twitt" in my exam­ple but you can call it what­ever you like. Then Pro­gram is the fully qual­i­fied path to the exe­cutable of the poster appli­ca­tion. Last col­umn is com­mand line argu­ments and you should set it to "$$". Notice that you need to put dol­lar sings in quo­ta­tion marks, oth­er­wise it won't work. When you're done just click OK, and we're all set.

launchy_twitter

Now you can invoke the com­mand in Launchy, press tab, and enter your mes­sage. When you're done just press enter and your mes­sage should get posted to Twitter.

launchy_twitter2

That's it. So far this is my favorite way of post­ing to Twitter.

As for Twitter.Poster, use it how­ever you like and don't sue me if it breaks some­thing. I pub­lish it on terms of BSD licence. How­ever, it uses Twit­ter­izer library, that is licensed under terms of GPL v3, so take that into account when cre­at­ing deriv­a­tive work.

This is just a sam­ple appli­ca­tion that I cre­ated mostly for myself. How­ever you can post bugs and fea­ture requests in com­ments. I don't want to promise any­thing, but I may imple­ment some of them if there's demand and I find some time.

Tech­no­rati Tags: ,
  • Ricky Smith

    Thanks for using the Twit­ter­izer 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 twit­ter­izer classes into your project. Instead, build the Twitterizer.Framework project and use the .dll it builds as a ref­er­ence in your project.

    Also, using the cur­rent ver­sion of twit­ter­izer (r34) here's a fixed "Main" method in Program.cs:

    sta­tic 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 (Excep­tion e)
    {
    MessageBox.Show(string.Format(errorMessage, e.Message), error­Header);
    }

    }

  • http://kozmic.pl/Default.aspx Krzysztof Koźmic

    Ricky,
    I didn't really want to drag another .dll with the app, or use IlMerge for some­thing so sim­ple. This is a proof of con­cept, rather than pro­duc­tion qual­ity code. If there's a demand to improve it, I actu­ally might some day (like do it the 'right way', as an actual plug-in to Launchy).

  • Ricky Smith

    No prob­lems. 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

    Down­loaded the zip file and fol­lowed all the steps to set up Runny but did not find a Twitter.Poster.exe file in the zip pack­age. There is a Twitter.Poster.csproj file. Any advice? Thanks in advance.

  • http://kozmic.pl/Default.aspx Krzysztof Koźmic

    Hi David.
    So far I only uploaded source code ver­sion. If you don't want to com­pile it your­self grab this: cid-6e18e107780d3f4a.skydrive.live.com/…/Twit…
    this is a binary ver­sion (ie Twitt.Poster.exe)
    Have fun.

  • mehdi

    Hi, thanks for use­ful arti­cle. I did your instruc­tions exactly as above arti­cle, i installed lat­est ver­sion Launchy, com­pile your app source within VS2008 Express Edi­tion and then i add the path as a new plu­gin to launchy, i also pro­vided my user/pass within con­fig file. Every thing looks fine but no post appears on my twit­ter page. i tried many times but no change. Do you have any idea about the problem?

    Thanks in advance
    mehdi

  • http://kozmic.pl/Default.aspx Krzysztof Koźmic

    @Mehdi
    One thing I can think of from the top of my head:
    Do you have a space char­ac­ter in your path? If that is the case, it may be the rea­son why Launchy is not pick­ing up the poster app.

  • mehdi

    Dear Krzysztof
    It was my fault not the space in my path or any thing else, your solu­tion worked per­fect. I was addressed wrong exe­cutable.
    Twitt.Poster solved my other prob­lem too. i was using "curl" for twit­ting and it couldnt post in Uni­code but Poster solved it.

    Thanks again
    Mehdi

  • mehdi

    Dear Krzysztof
    when i try to twitt i receive this error:
    "Twit­ter error: The remote server returned an error: (411)Length Required.."
    i was twit­ting for a few days with no errors, then what causes this error?

    Thanks
    Mehdi

  • http://kozmic.pl/Default.aspx Krzysztof Koźmic

    Mehdi,
    No idea what might be the cause. I just checked, and for me it works per­fectly fine. Does it hap­pen every­time you twitt?

  • Deepak

    Hello,

    Can any one help me in cre­at­ing account with twit­ter using twit­ter API. I want to add this func­tion­al­ity in my appli­ca­tion that new user can cre­ate their account on twit­ter from my own UI.

    Thanks

  • http://tomleo.com/ Tom

    Just thought of the idea of updat­ing via Launchy, glad to see that you have made this pos­si­ble. The Binary ver­sion was a huge time saver too.

  • Ted

    This is an inter­est­ing con­cept. What are your thoughts on a stand­alone launchy like appli­ca­tion for Twit­ter like samuelhaddad.com/software-projects/twittertalk/ for peo­ple who don't use launchy?

  • Ryan

    Would love to Tweet from Launchy but I can't seem to down­load the binary tool. The down­load link doesn't seem to work and I have no idea how to com­pile it myself.

  • Ryan

    Haha, well I found the down­load link in the com­ments that worked. Fol­lowed your instruc­tions and my tweets are show­ing up on Twit­ter. But, after every tweet I get an error about being unable to parse Twit­ter response. Any­thing you might sug­gest I check?

  • http://kozmic.pl/Default.aspx Krzysztof Koźmic

    That's prob­a­bly some change in the Twit­ter API.

    I would have to update to the newest ver­sion of Twit­ter­izer.
    I'll take a look later today

  • http://mohammad8x.wordpress.com/ Mohammad8x

    That's a great way to post­ing to twit­ter, thanks