Friday, July 29, 2005

YubNub Konfabulator widget (Windows)

Zheng has created a Konfabulator widget for YubNub. More details on his blog post (English, Chinese).

Blackberry YubNub integration with Berry411

Blackberry integration. Wired Dude Dave gives instructions on how to add YubNub to your Blackberry mobile device: I did something similar with Berry411 (an awesome search client for the blackberry). I just edited a new "plugin" feature to have a search string look like http://yubnub.org/parser/parse?command=%s Update: Berry411 creator Phillip Bogle has added YubNub to Berry411, so you can now type "yn: gim porsche" into your Blackberry. For more information, see Phillip's post. Here's a nice pic of YubNub on the Blackberry, from Wired Dude Dave:

Saturday, July 23, 2005

Jeremy's Picks

Jeremy Hussell has created an insightful page describing his picks for the best YubNub commands.

Call for awk, sed, grep, sort, tr commands

Sean O'Hagan (who has been working on HTML- and XML-parsing commands for YubNub) asks: "Thinking more about pipes and such, I thought that it'd be great if someone could (create and) host web versions of common pipe and filter commands like: awk, sed, grep, sort, tr, etc. (and commands from other operating systems too of course)"

Would someone be willing to create yubnub commands for awk, sed, grep, sort, tr, etc.? I suppose all you'd need to do would be to create PHP scripts (or whatever) that delegated to the real unix commands to do the heavy lifting. If the user passed you a URL, I guess you could pipe in the text using lynx.

Warning: this is a CPU/bandwidth intensive job! You might want to check the specs on your web server before contributing these commands!

Friday, July 22, 2005

YubNub down because of maintenance at TextDrive

My super web host TextDrive is doing maintenance on YubNub's server ("pendrell") so it will be down for a little bit. You can check on the status of pendrell here: http://status.textdrive.com/

Wednesday, July 20, 2005

YubNub + Google Earth Mashup

I. am. astonished. Stefan Geens has made a command called gearth that launches Google Earth with the address you give it. He made a PHP script that generates KML ... I'll let him do the explaining.

Windows/Linux/MacOSX/Python integration

Steve Milner has created a set of programs that allow access directly to YubNub directly from your computer (OS X, Linux or Windows). He calls it yubutils, and it has three parts: a GUI for YubNub, a command-line interface, and a Python library:






Tuesday, July 19, 2005

Improved random command, by Richard Frankel

Richard has made an improvement to the random command, allowing you to specify the min, the max, and how many numbers to generate.

Examples:
Richard's command is especially cool because you can combine it with other commands. For example, we can type fspell {random 10000} to generate a series of Flickr images, one for each digit of a random number from 1 to 10000, using Eric Kastner's fspell command.

And continuing our Penny Arcade example, you can get a random Penny Arcade comic from the last 365 days by typing in:
Neat!

Saturday, July 16, 2005

OK we've got pipes! How to combine YubNub commands together.

Alright, we now have a way to chain commands together (but our work is not yet done, as I will explain in a moment).

For example, to see the Penny Arcade comic from a week ago, we can combine the paview and date commands as follows:

paview {date -format Y-m-d -offset -7}

Type that into YubNub and you will be taken to last week's Penny Arcade comic:



So to use the output of one command as the parameter for another, simply enclose the command in {curly brackets}.

And that's not all. If you find yourself often typing paview {date -format Y-m-d -offset -${age=7}}, you can make a new command for it. Just make a new command called paview2 with the following URL:

paview {date -format Y-m-d -offset -7}

No that is not a typo -- you type the same thing into the Create New Command box as you do into the YubNub command line. In other words, you can create new commands by combining existing ones together. So now you can type paview2 and it will take you to last week's Penny Arcade comic.


We can even make a paview3 command that is a bit more flexible. This third version will let you optionally specify the age of the Penny Arcade comic that you want, in days (see Advanced Syntax for more information on parameters and default values). Give paview3 the following URL:

paview {date -format Y-m-d -offset -${age=7}}

Now you can type paview3 to get last week's comic, or paview3 -age 20 to get the comic from 20 days ago, etc.

Note that this technique cannot be used to pass huge chunks of text between commands. This technique is used to pass small snippets of text, which is perfect for specifying parameters as in the examples above.



I said at the start of this post that our work is not yet done. We need more little commands (like echo, date, and url) that generate useful snippets of text that can be inserted into other commands. We also need a screen-scraper command to make it easier for people to make these little commands. Sean O'Hagan is working on a screen-scraper -- alternative implementations are also welcome.

I would like to acknowledge two people who have been doing R&D on combining commands together: Erik Kastner and Richard Frankel. I would also like to acknowledge the ideas of several individuals regarding syntax and implementation -- these include Bill Katz, Nick Fortune, Michael Pacchioli, Ciro Mondueri, Alex Ksikes (Alex has a ton of ideas) and more recently: Jeremy Hussell, Mathieu Balez, and Sean O'Hagan.

Thursday, July 14, 2005

"url" command, suggested by Jeremy Hussell

Introducing a new YubNub core command, url, which will help people who are experimenting with chaining YubNub commands together (like Sean O'Hagan and Erik Kastner).

url simply converts a YubNub command into a URL. For example,
url gim porsche 911
displays the following text:
http://images.google.com/images?q=porsche+911

For the syntax for combining commands, I will probably go with Jeremy Hussell's suggestion of { curly brackets }. I envision it working both at "compile time" and at "runtime"; that is, both in the Add Command screen and at the YubNub command line. Tony Pitale has suggested a "today" command, and this would be a perfect application, both at compile time and runtime: {today -format yyyymmdd -offset 15}

Sunday, July 10, 2005

An Idea for Combining Commands: ${...} rather than pipes

Today I was talking with Michael Pacchioli about the syntax for combining commands. I'm leaning toward using ${...} (I can't remember who suggested it to me a few weeks back).

Something like:
gim ${parse ${gnews royal wedding}}
Well, it will unfortunately be uglier than that (especially the parse command), but that's the idea. Basically using a command called "parse" to extract a short snippet of text to pass to the outer command as a parameter.

Sean O'Hagan is doing some great work on a parser.php script that I would like to use for the parse command.

Tip: Bookmarklet for creating those POST urls

As you probably know, you can tell YubNub to do a POST instead of a GET by putting [post] somewhere in the URL when you create the command (thank Sean O'Hagan for adding that capability).

But it can be a headache to try to construct the URL by looking at the HTML source. So go to Stephen Ostermiller's bookmarklets and drag his "Forms To GET" bookmarklet to your toolbar. Then press it to convert that POST form to a GET form so you can see the parameters in your address bar when you submit it.

Saturday, July 09, 2005

YubNub Mobile page, by Sean Bonner

Sean Bonner has made a little YubNub Mobile page that is optimized for mobile devices (like his Treo).



Tuesday, July 05, 2005

Default Values for Multiple Parameters

OK you can now specify default values for your parameters (syntax suggested by Christopher Church). Continuing our pizza example, here we specify the default "what" to be "tennis shoes", and the default "where" to be "Washington, DC":
http://www.google.com/local?sc=1&hl=en&q=${what=tennis shoes}&near=${where=Washington, DC}&btnG=Google+Search&rl=1
Now if the user does not specify a "what"...
gloc -where Poughkeepsie, NY
...it will default to "tennis shoes" and they will be taken to...
http://www.google.com/local?sc=1&hl=en&q=tennis+shoes&near=Poughkeepsie%2C+NY&btnG=Google+Search&rl=1
Similarly, if they do not specify a "where", it will default to "Washington, DC".

Saturday, July 02, 2005

Experimentation with pipes (sorta)

Well, there is research being done on making pipes for YubNub commands, and it isn't being done by me! Erik Kastner (creator of the spell with flickr website that's been making the rounds) is experimenting with combining YubNub commands. From Erik's email:
I made a new yubnub command"chain" -- A way to chain commands together. It's VERY beta right now and only supports:
  • ftot (my new command for making an atom feed into text- which is broken b/c of an apache thingie)
  • fspell
  • random
Example: chain random 42 fspell
Erik is taking us the first few steps into The Dream: combining YubNub commands together. This is the inflection point, the Singularity. On the day that YubNub commands can truly, freely interact with each other, great things will happen.

Update: Eric sends me this in an email: chain ftot -url http://aom.metaatem.info/person/kastner/feed -titles 1 -bodies 1 -limit 1 fspell Looks like it's beginning to really take shape!

Friday, July 01, 2005

Auto-translating the current page

YubNub can be useful in so many ways. For example, let's say you go to a page in another language. Here's one written in ... Spanish, I guess? Anyway, I don't need to know because the autotr command will figure out what language it is in and convert it to English for me. And if you've installed YubNub as a keyword in your browser, all you need to do is stick a "y autotr" before the URL in your address bar, and presto, it's automatically translated into English for you!

This technique also works great for the "tiny" command (which turns very long URLs into very short ones). Just stick a "y tiny" before the URL in your address bar, and tiny will convert it to a tiny url.

Now there's a way to test your commands

I just finished implementing a good suggestion from Jürgen Antes and Jeremy Hussell: give YubNub a way to let you test your command before you submit it.

YubNub SmartPhone/PocketPC installation

If you have a SmartPhone or PocketPC and surf the web with MultiIE, you can turn your address bar into a YubNub command line:



Just go to MultiIE Options > Misc > Address Bar Macros > Open Button Custom 1, then type in the following: http://yubnub.org/parser/parse?command=#^;-YubNub (as shown below). You will then be able to enter a YubNub command (like "gim porsche 911") then click YubNub (as shown above).

Turning off URL Encoding

Normally YubNub will apply "URL encoding" to parameters. For example, "gim Mork & Mindy" gets turned into http://images.google.com/images?q=Mork+%26+Mindy (note that the & became +%26+). This is what works for most websites. However, W. Van Hooste pointed out that this does not work for the Internet Archive Wayback Machine. To tell YubNub to turn off URL encoding, include the following text somewhere in your URL: [no url encoding]

For example, if you make a command called arch with the following URL...
http://web.archive.org/web/*/%s[no url encoding]
...when the user types...
arch http://www.ing.be/
...they will be taken to...
http://web.archive.org/web/*/http://www.ing.be/
If you hadn't specified [no url encoding], the user would have been taken to http://web.archive.org/web/*/http%3A%2F%2Fwww.ing.be%2F