ratox-nuggets

useful ratox related scripts
git clone git://git.2f30.org/ratox-nuggets.git
Log | Files | Refs | LICENSE

commit 89e5d3878dd61042c39f9e5e6862294d709602a3
parent da5a0e686d2ba8e76baea06d705b581148a77393
Author: sin <sin@2f30.org>
Date:   Tue Oct  7 17:55:20 +0100

Prefix nuggets

Diffstat:
echo | 4----
rat-echo | 4++++
rat-remotemic | 10++++++++++
rat-weather | 11+++++++++++
remotemic | 10----------
weather | 11-----------
6 files changed, 25 insertions(+), 25 deletions(-)
diff --git a/echo b/echo @@ -1,4 +0,0 @@ -#!/bin/sh -# Echo script by myroslav - -tail -n0 -f text_out > text_in diff --git a/rat-echo b/rat-echo @@ -0,0 +1,4 @@ +#!/bin/sh +# Echo script by myroslav + +tail -n0 -f text_out > text_in diff --git a/rat-remotemic b/rat-remotemic @@ -0,0 +1,10 @@ +#!/bin/sh +# A simple remote microphone script by myroslav + +while true; do + while grep -q 0 call_pending; do + inotifywait -t 60 -e modify call_pending; + done; + (cat call_out > /dev/null &) + arecord -r 48000 -c 1 -f S16_LE >>call_in; +done diff --git a/rat-weather b/rat-weather @@ -0,0 +1,11 @@ +#!/bin/sh +# +# Simple weather oracle script by myroslav + +tail -n0 -f text_out | while read line; do + address=${line:17:${#line}} # strip off date time + curl -s --get --data-urlencode "query=$address" \ + http://api.wunderground.com/auto/wui/geo/ForecastXML/index.xml | \ + perl -ne '/<title>([^<]+)/&&printf "%s: ",$1;/<fcttext>([^<]+)/&&print $1,"\n"' | \ + perl -MHTML::Entities -pe 'decode_entities($_);' +done > text_in diff --git a/remotemic b/remotemic @@ -1,10 +0,0 @@ -#!/bin/sh -# A simple remote microphone script by myroslav - -while true; do - while grep -q 0 call_pending; do - inotifywait -t 60 -e modify call_pending; - done; - (cat call_out > /dev/null &) - arecord -r 48000 -c 1 -f S16_LE >>call_in; -done diff --git a/weather b/weather @@ -1,11 +0,0 @@ -#!/bin/sh -# -# Simple weather oracle script by myroslav - -tail -n0 -f text_out | while read line; do - address=${line:17:${#line}} # strip off date time - curl -s --get --data-urlencode "query=$address" \ - http://api.wunderground.com/auto/wui/geo/ForecastXML/index.xml | \ - perl -ne '/<title>([^<]+)/&&printf "%s: ",$1;/<fcttext>([^<]+)/&&print $1,"\n"' | \ - perl -MHTML::Entities -pe 'decode_entities($_);' -done > text_in