I have been a user of Launchy ( www.launchy.net ) for a long while now, it is a great little tool.
Lifehacker, has a post that sets out how to use Launchy to post to your twitter account using dos batch files and curl.
In this post I want to just elaborate a bit on what they have in their post and also include my addition; posting activities to Plazes in a similar way.
The two hacks are brilliant, I am just hacking them together to a single action, dual postings shortcut.
First, I'll outline how it all fits together, then I'll show you in detail.
Outline:
--------
So here is how it works, you write a batch file that uses curl to access the API to twitter/plazes and posts whatever you pass the script.
for example:
C:\twit.bat just testing
Will post "just testing" to your twitter.
By tweaking Launchy, you can then avoid "dropping to DOS" and can type "twit", press tab, then type "just testing" and your script will run and post "just testing" to twitter.
Details:
--------
This is a slightly modified (enhanced?) version of the Lifehacker method, which includes some of the ideas from the comments on the post to make the whole process a bit more polished.
Step 1. Get all the parts.
============================
First things first, lets get all the freeware and batch files etc that you'll need.
Launchy: Get and install Launchy from www.launchy.net
curl: Get the windows version of curl from http://curl.haxx.se/
twit.bat: Copy the text below into a text editor and save as twit.bat
plaze.bat: Copy the text below into a text editor and save as plaze.bat
Save twit.bat and plazes.bat into a folder somewhere on your machine, like my documents, anywhere that is not going to get indexed by Launchy.
Step 2. Edit the batch files
===============================
If you have read the LifeHacker post, you'll see my twitter script is ever so slightly different to theirs.
I added the TITLE line, which is handy in a little while as it puts "Tweeting" as the title of the window, so makes it identifyable when minimised. (Bear with me)
You need to replace username:password with your actual username and password for twitter. So fire up notepad/wordpad and edit that now. And, yes I do appreciate that you are leaving your password in plain text and I'm choosing to take the risk.
plaze.bat is a little more complicated, first change the username:password pair in the file. Next replace [id] with the numerical ID for your location.
Okay lets pause for a moment (especially if you don'y know your numeric location ID). Plazes is location specific and I use the Plazer on my laptop, which does the posting and location stuff for me.
But in the office, I can't/won't install the plazer. This is for two reasons, one my office does not move and two we keep our PCs pretty clean for security and AUP reasons.
Now, because this is a hack I did for my desktop pc at work, it (and the office) don't move much so it makes the hack easier.
With Plazes, you need to put a location ID, so if you are not moving (as in my case) you can hardcode the location into the script. If you want to use this hack on a laptop... well good luck.
So you need to know you location, this is pretty easy. First, login to plazes.com and make sure you have set your location to where you want to find the location for.
Next enter this into the address bar:
Now click on the location link to see details of the Plaze, then look at the url, it should look something like this:
http://plazes.com/plazes/99220_alexandra_palace
This is the Url for the Plaze "Alexandra Palace", (where I did my first Plazes hack at Hackday London 2007).
See that number "99220", that is the numeric identifier for your plaze, put that into your script.
Step 3. Create Shortcuts
===========================
Here, we deviate from lifehackers main post and into the comments from that post.
First, right click on twit.bat and then click "Create Shortcut"
Now rightclick on the shortcut, and then choose Properties.
Change the RUN box to minimise and then click on CHANGE ICON, after the initial error popup, choose a shiny new icon for the shortcut.
Click all the ok buttons till everything is done.
Repeat for the other batch file.
then rename both to be simply twit.bat and plaze.bat
Step 4. Move the shortcuts
===========================
Cut and paste the shortcuts into C:\Program Files\Launchy\Utilities (or where ever is appropriate for your installation)
Step 5. Configure Launchy
===========================
Bring up Launchy using the hot key (I changed mine to CTRL+SPace to match QUicksilver on my Mac), but the default is ALT+SPACE.
Right click on the dialog and go into OPTIONS
Then click the Catalog button
click on the Utilities\ directory listed in the big box on the right.
Then, on the left under the box with *.lnk in it, click the "+" button and add *.bat
Click on "Rescan Catalog" for good measure.
Hit okay to save the changes then hit the escape key to close the Launchy Dialog
Step 6. Test and enjoy!
========================
Bring up Launchy (ALT+SPACE)
type twit
hit the tab key
type the text you want to send to twitter
hit return
Now go to twitter and see if it worked!
If so, then try plazes, if not... check you did everything right. Maybe throw a PAUSE at the bottom of the batch file and take alook at what is happening.
Now, I have a confession to make, I did not install curl as shown above, as I had it on my machine already from my cygwin installation, so if it does not work, it might be that you need to put curl in your path or move curl to the folder with the batch files (or the windows directory of course).
Let me know how you get on.
Lance.
Lifehacker, has a post that sets out how to use Launchy to post to your twitter account using dos batch files and curl.
In this post I want to just elaborate a bit on what they have in their post and also include my addition; posting activities to Plazes in a similar way.
The two hacks are brilliant, I am just hacking them together to a single action, dual postings shortcut.
First, I'll outline how it all fits together, then I'll show you in detail.
Outline:
--------
So here is how it works, you write a batch file that uses curl to access the API to twitter/plazes and posts whatever you pass the script.
for example:
C:\twit.bat just testing
Will post "just testing" to your twitter.
By tweaking Launchy, you can then avoid "dropping to DOS" and can type "twit", press tab, then type "just testing" and your script will run and post "just testing" to twitter.
Details:
--------
This is a slightly modified (enhanced?) version of the Lifehacker method, which includes some of the ideas from the comments on the post to make the whole process a bit more polished.
Step 1. Get all the parts.
============================
First things first, lets get all the freeware and batch files etc that you'll need.
Launchy: Get and install Launchy from www.launchy.net
curl: Get the windows version of curl from http://curl.haxx.se/
twit.bat: Copy the text below into a text editor and save as twit.bat
@echo off
TITLE Tweeting
Echo Tweeting...
cd c:\
cmd /c curl --basic --user username:password --data status="%*" http://twitter.com/statuses/update.xml
Echo Exiting...
plaze.bat: Copy the text below into a text editor and save as plaze.bat
@echo off
TITLE Plazing
Echo Plazing...
cd c:\
curl -u username:password -X POST -H "Content-Type: application/xml" http://plazes.com/activities.xml -d "<activity><status>%*</status><plaze_id>[id]</plaze_id></activity>"
Echo Exiting...
Save twit.bat and plazes.bat into a folder somewhere on your machine, like my documents, anywhere that is not going to get indexed by Launchy.
Step 2. Edit the batch files
===============================
If you have read the LifeHacker post, you'll see my twitter script is ever so slightly different to theirs.
I added the TITLE line, which is handy in a little while as it puts "Tweeting" as the title of the window, so makes it identifyable when minimised. (Bear with me)
You need to replace username:password with your actual username and password for twitter. So fire up notepad/wordpad and edit that now. And, yes I do appreciate that you are leaving your password in plain text and I'm choosing to take the risk.
plaze.bat is a little more complicated, first change the username:password pair in the file. Next replace [id] with the numerical ID for your location.
Okay lets pause for a moment (especially if you don'y know your numeric location ID). Plazes is location specific and I use the Plazer on my laptop, which does the posting and location stuff for me.
But in the office, I can't/won't install the plazer. This is for two reasons, one my office does not move and two we keep our PCs pretty clean for security and AUP reasons.
Now, because this is a hack I did for my desktop pc at work, it (and the office) don't move much so it makes the hack easier.
With Plazes, you need to put a location ID, so if you are not moving (as in my case) you can hardcode the location into the script. If you want to use this hack on a laptop... well good luck.
So you need to know you location, this is pretty easy. First, login to plazes.com and make sure you have set your location to where you want to find the location for.
Next enter this into the address bar:
Now click on the location link to see details of the Plaze, then look at the url, it should look something like this:
http://plazes.com/plazes/99220_alexandra_palace
This is the Url for the Plaze "Alexandra Palace", (where I did my first Plazes hack at Hackday London 2007).
See that number "99220", that is the numeric identifier for your plaze, put that into your script.
Step 3. Create Shortcuts
===========================
Here, we deviate from lifehackers main post and into the comments from that post.
First, right click on twit.bat and then click "Create Shortcut"
Now rightclick on the shortcut, and then choose Properties.
Change the RUN box to minimise and then click on CHANGE ICON, after the initial error popup, choose a shiny new icon for the shortcut.
Click all the ok buttons till everything is done.
Repeat for the other batch file.
then rename both to be simply twit.bat and plaze.bat
Step 4. Move the shortcuts
===========================
Cut and paste the shortcuts into C:\Program Files\Launchy\Utilities (or where ever is appropriate for your installation)
Step 5. Configure Launchy
===========================
Bring up Launchy using the hot key (I changed mine to CTRL+SPace to match QUicksilver on my Mac), but the default is ALT+SPACE.
Right click on the dialog and go into OPTIONS
Then click the Catalog button
click on the Utilities\ directory listed in the big box on the right.
Then, on the left under the box with *.lnk in it, click the "+" button and add *.bat
Click on "Rescan Catalog" for good measure.
Hit okay to save the changes then hit the escape key to close the Launchy Dialog
Step 6. Test and enjoy!
========================
Bring up Launchy (ALT+SPACE)
type twit
hit the tab key
type the text you want to send to twitter
hit return
Now go to twitter and see if it worked!
If so, then try plazes, if not... check you did everything right. Maybe throw a PAUSE at the bottom of the batch file and take alook at what is happening.
Now, I have a confession to make, I did not install curl as shown above, as I had it on my machine already from my cygwin installation, so if it does not work, it might be that you need to put curl in your path or move curl to the folder with the batch files (or the windows directory of course).
Let me know how you get on.
Lance.