Archive for February, 2007

Very Simple Perl Script for running yubnub commands

Sunday, February 11th, 2007

Here’s a very simple perl script for running yubnub commands.

save the following using your favorite editor (e.g. linux vi)

use warnings;

use LWP 5.64;

$a = LWP::UserAgent->new;

$b = 'http://www.yubnub.org/parser/parse?command='.$ARGV[0];

$c = $a->get($b);

print  $c->content;

Here’s an example of using the script (assuming you saved it with the name “yubnub”:

perl yubnub ” 2t http://del.icio.us/tag ”

perl yubnub ‘2t http://del.icio.us/tag’

n.b. the quotes are required

What did this command do?

it asked yubnub to run the 2t command against url http://del.icio.us/tag

what is http://del.icio.us/tag ?

http://del.icio.us/tag is a list of tags that del.icio.us thinks are very popular.

what is “2t” ?

2t is a yubnub command that translates html into text.

Here are the results of running that command n.b. this should be very usuable for unix users:

$ perl yubnub “2t http://del.icio.us/tag”
[skip to content][1]

[1]: #main

# [del.icio.us][2] / tag /

[2]: /

[popular][3] | [recent][4]

[3]: /popular/
[4]: /recent

[**login**][5] | [**register**][6] | [**help**][7]

[5]: https://secure.del.icio.us/login
[6]: https://secure.del.icio.us/register
[7]: /help/

del.icio.us the web

## Popular tags on del.icio.us

This is a **tag cloud** - a list of tags where size reflects popularity.

sort: alphabetically | [by size][8]

[8]: /tag/?sort=freq

[.net][9] [ajax][10] [apple][11] [architecture][12] [art][13] [article][14] [articles][15] [audio][16] [bit200w07][17] [blog][18] [blogging][19] [blogs][20] [book][21] [books][22] [business][23] [comics][24] [community][25] [computer][26] [cooking][27] [cool][28] [css][29] [culture][30] [daily][31] [design][32] [development][33] [dictionary][34] [diy][35] [download][36] [education][37] [email][38] [english][39] [entertainment][40] [environment][41] [fashion][42] [fic][43] [film][44] [finance][45] [firefox][46] [flash][47] [food][48] [free][49] [freeware][50] [fun][51] [funny][52] [game][53] [games][54] [gen][55] [google][56] [graphics][57] [gtd][58] [hardware][59] [health][60] [history][61] [home][62] [howto][63] [html][64] [humor][65] [illustration][66] [imported][67] [inspiration][68] [internet][69] [japan][70] [java][71] [javascript][72] [jobs][73] [language][74] [learning][75] [library][76] [lifehacks][77] [linux][78] [mac][79] [magazine][80] [maps][81] [marketing][82] [math][83] [media][84] [microsoft][85] [mobile][86] [money][87] [movies][88] [mp3][89] [music][90] [network][91] [news][92] [online][93] [opensource][94] [osx][95] [photo][96] [photography][97] [photos][98] [photoshop][99] [php][100] [podcast][101] [politics][102] [portfolio][103] [productivity][104] [programming][105] [python][106] [radio][107] [rails][108] [recipes][109] [reference][110] [religion][111] [research][112] [resources][113] [rss][114] [ruby][115] [school][116] [science][117] [search][118] [security][119] [seo][120] [service][121] [shopping][122] [slash][123] [social][124] [software][125] [tech][126] [technology][127] [tips][128] [tool][129] [tools][130] [toread][131] [travel][132] [tutorial][133] [tutorials][134] [tv][135] [ubuntu][136] [video][137] [videos][138] [web][139] [web2.0][140] [webdesign][141] [webdev][142] [wiki][143] [windows][144] [wordpress][145] [work][146] [writing][147] [youtube][148]

[9]: /tag/.net
[10]: /tag/ajax
[11]: /tag/apple
[12]: /tag/architecture
[13]: /tag/art
[14]: /tag/article

—– a bunch more tags —-

[152]: http://del.icio.us/about
[153]: http://blog.del.icio.us/
[154]: http://del.icio.us/help/terms
[155]: http://del.icio.us/help/privacy
[156]: http://del.icio.us/help/copyright
[157]: http://del.icio.us/help/support