Skip to content

Instantly share code, notes, and snippets.

@bkerley
Created December 1, 2008 23:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bkerley/30897 to your computer and use it in GitHub Desktop.
Save bkerley/30897 to your computer and use it in GitHub Desktop.
proc twitgrep q {
set page [wget http://search.twitter.com/search.atom?q=$q];
set titles [regexp -all -inline {<title>(.*?)</title>} $page];
set names [regexp -all -inline {<uri>(.*?)</uri>} $page];
set i 3;
set j 1;
set x "cocks";
while {$x ne ""} {
set x [lindex $titles $i];
set n [lindex $names $j];
lappend out "[bold]$n[bold] $x";
incr i 2;
incr j 2;
}
html [join $out "\n"]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment