-
Notifications
You must be signed in to change notification settings - Fork 1
Usage examples
fczuardi edited this page Aug 24, 2010
·
11 revisions
This is a collection of some of the neat things you can achieve by combining the Trending Topics Client with other UNIX utilities.
Just open a terminal window and paste the code snippets below to run them.
node ttc.js |grep -e"^[1-5]\. "
or
node ttc.js -f names|head -n 5
node ttc.js | sed s/.-.http.*//
node ttc.js -f names | head -n 10 | nl -s ". "
node ttc.js --help | grep Paulo
mkfifo pipe1 node ttc.js -f json --location mx > pipe1 & cat pipe1 > output.json
mkfifo pipe1 node ttc.js -f json --location mx > pipe1 & cat pipe1 >> output.json
node ttc.js --location mx > pipe1 & cat pipe1 >`date +%s`.log
while [ 0 ]; do node ttc.js -l 455827 | tail -n 17 >> sptrends.log; sleep 300; done;
mkfifo pipe1 pipe2 node ttc.js -l br > pipe1 & node ttc.js -l 455827 > pipe2 & diff -y pipe1 pipe2
node ttc.js -f names -l br > pipe1 & node ttc.js -f names -l 455827 > pipe2 & perl -ne 'print if ($seen{$_} .= @ARGV) =~ /10$/' pipe1 pipe2
(credit: http://www.cyberciti.biz/faq/command-to-display-lines-common-in-files/ )
node ttc.js -f names | head -n 10 | nl -s ". " | growlnotify --title "Trending Topics"
node ttc.js | tail -n 15 | sed s/.-.http.*// | growlnotify
while [ 0 ]; do node ttc.js -l br | tail -n 15 | sed s/.-.http.*// | growlnotify --title "Trending Topics"; sleep 300; done;