Lance Wicks
Kiwi,
Judoka,
Geek,
Husband
Daddy!

JudoGeek Blog

Plazes and Twitter postings via the Life Hacker Launchy hack. 

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


@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.


[ view entry ] ( 4701 views ) permalink related link
We don't know how lucky we are! 

This will be the final video I post for a while... honest!
here is the honourable Fred Dagg and guests performing what could/should replace "God of Nations" perhaps as the New Zealand national anthem.
Enjoy!

[ view entry ] ( 2122 views ) permalink
LOL. This is AWESOME, Will Smith is great! 



So now there are TWO will smith films I REALLY want to see, Hancock and I Am Legend.

"Props" to Marc Andreessen for pointing this one out!


[ view entry ] ( 1354 views ) permalink
What Bubble? 

[ view entry ] ( 1580 views ) permalink
E90, a brief review. 

So... I've had my E90 for a bit over a week and thought I'd jot down a few thoughts on it and how it suits me.

The E90 is definitely as most people (Steve Litchfield for example) have described it a refinement of the Communicator series rather than a radical change a-la the iPhone. Yes, moving from series 80 to series 60 is a big move, but from a user perspective it's not a big deal.

As a former Nokia 9500 user I have lost the use of my thumbs for texting/typing, which is what made the final decision when it came to what phone to get. And the keyboard on the e90 is quite nice, a bit stiff and my space bar is almost impossible to tell if it has been pressed or not. Maybe thats just it being new, or maybe a design flaw, I don't know.

Size-wise, its a smaller, slimmer package than the 9500. yes bigger than the average phone, but not as monstrous as the 9500 was. Which makes me look less like some guy with a 80's mobile phone, which is nice.

Some things I have been impressed with are...
The fact that I can start an application on the outside screen, and then flip the phone open and the same application pops open. Also, built is is automatic email checking, so every half hour my phone pings my pop3 server. You could do this on the 9500 with some freeware from the same Steve as above, but it's nice Nokia have included it.
GPS is a great addition also, yes it takes a while to get a signal, but so did my external GPS previously. What I don't like much is paying extra to get voice navigation after spending so much on a phone with GPS. Minor irritation, but an irritation none the less.

Which brings me to Google Maps (v. 2), which it awesome! Stunning even! The my location feature is amazing and very cool to show folks. It is the location finding via cell towers and it works pretty darn well, especially in London. Unlike GPS, the google feature worked inside a restaurant in London, and was pretty accurate. Being able to load all the satellite imagery is cool as well and be able to zoom right in is great.
I left it running all the way from Basingstoke to home one night and it was very cool watching the the dot representing me traverse satellite imagery of the M3. I had it zoomed in pretty close so it showed things like the chevrons where lanes merged, which was amazing.
If Google Maps had better navigation, that kept up with where you were and importantly had voice, I would not have bothered buying the same feature for the nokia software.
One bug bear on this is that the Google software could do with some caching on the maps, it downloads them via GPRS/GSM so is pretty data hungry, so a cache on the ample memory of the E90 would be great.

One other app I have loaded and was impressed with is Agile Messenger, which I had on the 9500 and love. They earned massive brownie points as I don't seem to have had to get it relicensed. I thought that with a new IMEI I would have to but it must be tied to my SIM or something I guess. Guys, thanks! Seamless is a big plus. It adds better voice and video support on the E90 I think so that is cool. One weird thing though is that when I use the inside screen the command buttons seem to be opposite to what is shown. It is much nicer on the outside screen anyway so no biggie!

Finally, I have also loaded Python as it seems to have taken the place OPL held as development language of choice now days. Not done Python before, so should be fun. There is a book on Python for Mobiles ( Mobile Python: Rapid prototyping of applications on the mobile platform: Rapid Prototyping of Applications on the Mobile Platform ) which I shall probably get. Maybe then I can help Dirk with a location aware client for Noserub eh?!

Anyway... in summary. The E90 is very much a happy purchase for me, glad however I got it of eBay not from a Nokia/Vodafone/retail store as I got it a lot cheaper than the 600-800 notes regular channels wanted. (and yes I know Expansys have it for about 300, but I didn't pay much more than that and didn't need to change contract etc.

Lance.
[ view entry ] ( 1494 views ) permalink

<<First <Back | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | Next> Last>>