View Single Post
No!No!No!Yes!'s Avatar
Posts: 700 | Thanked: 846 times | Joined on Nov 2009
#10


And now... let's get ready for the 2010 MLB season...

Before using this Beecon make sure you have "wget" package installed:

Start X-Terminal and type:
Code:
Nokia-N900-51-1:/home/user/MyDocs# wget
wget: missing URL
Usage: wget [OPTION]... [URL]...

Try `wget --help' for more options.
Nokia-N900-51-1:/home/user/MyDocs#
If you don't receive the above output you need to install the package:
Code:
apt-get install wget
Beecon provides periodic updates for matches of your favourite MLB team:
Code:
wget -q -O - http://m.mlb.com/scores/`date +%Y%m%d`/ | awk 'BEGIN{t="NYY";m=0}/<td>.+<\/td>/{split(gensub(/<[^>]*>/,"","g"),a);if(a[1]!=t && a[3]!=t && a[4]!=t)next;m=1;if(a[2]=="vs."){print a[1] "\n" a[3] "\n" a[4],a[5];exit 1}print a[1],a[2] "\n" a[4],a[5] "\n" a[6];if((a[4]==t&&a[5]>a[2])||(a[1]==t&&a[2]>a[5]))exit 0;if(a[5]==a[2])exit 1;else exit 2}END{if(m==0){print "No\nMatch!\n";exit 1}}'
Just replace the:
Code:
t="NYY"
with one of the predefined abbreviations:
ATL, LAD, NYY, TOR, FLA, NYM, BOS, BAL, CIN, WSH, SD, PHI, SF, PIT, CHC, HOU, CLE, CWS, DET, KC, MIL, STL TB, TEX, MIN, OAK, LAA, SEA, COL, ARI.

Set update interval as you like and enjoy...

Beecon will return:
Exit Status 0 (Green Beecon) if team is winning
Exit Status 1 (Yellow Beecon) if match is tied up or no match for the day or match starting later on
Exit Status 2 (Red Beecon) if team is losing the match



Last edited by No!No!No!Yes!; 2010-02-24 at 17:35.
 

The Following 2 Users Say Thank You to No!No!No!Yes! For This Useful Post: