View Single Post
No!No!No!Yes!'s Avatar
Posts: 700 | Thanked: 846 times | Joined on Nov 2009
#1
As promised... here's the walkthrough and tutorial to customize Queen BeeCon Widget to display near Real Time MLB Major League Baseball Matches results.
The Widget is also capable of showing different icons/images/emoticons according to the result of a Favourite Team. (My kiddo's NYY)
In the picture there is also an example of an other customization of Queen BeeCon Widget for displaying my favourite Today's TV Serials which are aired during the day (source is TVRage.com). This will be discussed in another future thread...



Preparation Steps:
  1. Download and Install Queen Beecon Widget (Warning! It's still in extras-devel; if you like it, I need your support for testing and promoting to Testing and Extras)
  2. Download the following icons/images (Also attached to the thread for your convenience) and store them in the specified N900 directory, create it if not existing



Just drop them HERE:


Let's go...

Three usual and basic steps to instantiate the Widget:





Now click on the Settings Wrench Icon and we reach the Settins Dialog.

1) Make sure this is Beecon (our command's Exit Codes will be dynamically managed)
2) Command to be replaced
3) We will now create the command to be associated to the Beecon by clicking on 3. The command will fetch the MLB Results content from the internet (mobile site) and parse it.


1) Let's specify the Command Title: "MLBeeCon"
2) Let's paste our specialist fetching/parser command in this field here:
In code, replace t="NYY" with t="your team here" (short form)
Code:
echo "<span foreground=\"green\"><big><i>[`date +%m/%d/%Y`]</i></big></span>"; wget -t 1 -T 10 -q -O - http://m.mlb.com/scores/`date +%Y%m%d`/ | awk 'BEGIN {t="NYY";m=0;}/<td>.+<\/td>/{s=gensub(/<[^>]*>/,"","g");s=gensub(/[\t ]+/," ","g",s);split(s,a);if(a[1]!=t && a[3]!=t && a[4]!=t){print s;next;}m=1;print "<span foreground=\"cyan\"><b><big>" s "</big></b></span>";if(a[2]=="vs.") {ex=1;next;}if((a[4]==t&&a[5]>a[2])||(a[1]==t&&a[2]>a[5])) {ex=0;next;}if(a[5]==a[2]) {ex=1;next;} else {ex=2;next;}}END {if(m==0) {print "No\nMatch!\n";exit 1;} else exit ex;}'


1) Setup the width of our Beecon to around the background image Width
2) Same for Heigth
3,4) Help fine tuning the X,Y position of the Widget on Desktop


1) We don't want any background
2) This only applies to Snippets (not our case)


1,3,5,7) Specify the images to display for the different Command's Exit Status
2,4,6,8) Specify the relevant Beecon background color (not relevant, we've hidden it in previous step)
9,10) Specify basename for images in case we want different icons/background for Command Exit Codes >=3 (not relevant now)


1) This is the filename of our background image
2) Position it in the center of our widget
3,4) Font Family/Size here (This is for the command title label; the "MLBeecon..." in cyan/italics in desktop picture)
5,6,7) Visibility (Hidden/Position), Color & Justification of our label.


1) Image is not relevant here as we rely upon the Exit Status icons/images. (Trailing ";" disables image)
2) Position smileys Status icons/images at bottom right corner of our widget
3,4) Font Family/Size here (This is for default MLB Results text overridden by Pango Markup Language outputted by command)
5,6,7) Visibility (Hidden/Position), Color & Justification of our label.


1) Update at system startup
2) When clicked
3) When desktop gains focus
4) Every 5 minutes
5) When connected to network/internet
6) We Save and Run command immediately


And Here we Are!!!

In next post I'll explain details about the command used for the Beecon.

Credits go to the cited Companies, Organizations, Product, Services. Please report if any contents is neither appropriate nor allowed to be published and it will be removed within short time span.
Attached Images
     
__________________
Have a look at Queen BeeCon Widget (WIKI) Customizable and flexible widget-based multi-instance monitoring, alerting and interactive tool for the N900
Please provide comments and feedback for having QBW supported and enhanced further - (DONATE) - v1.3.3devel / v1.3.3testing / v1.3.3extras

Last edited by No!No!No!Yes!; 2010-03-17 at 23:52.