View Single Post
No!No!No!Yes!'s Avatar
Posts: 700 | Thanked: 846 times | Joined on Nov 2009
#1
Customize Queen BeeCon Widget (>=v0.1.4) to display:
World Cup 2010 South Africa - Live Results, News and Next Matches

The Beecon will also provide the most recent WC2010 news and will be able to highlight the match of your favourite Team and display, behind mascot, a Green ball if it is winning, Yellow ball if match is tied, Red ball if team is losing, White ball if match is still not currently being played. See THIS post for more Leagues/Tournaments



Ready?!

Preparation Steps:
  1. Download and Install Queen Beecon Widget (>=v0.1.4) (Warning! It's still in extras-devel; if you like it, I need your support for testing and promoting to Testing and Extras)

  2. Save icons/images attached to the post (or Download and extract zip file attached to the thread for your convenience) and store images in the specified N900 directory, create it if not existing. (Warning: inside the zip file there could be images with numbers appended to common graphic filenames extensions - ex. football-icon.png.3 - this is NOT an error!) - Do NOT save the following images as their filename will not be correct!






  3. Just drop them HERE:


  4. Make sure you copy the following Exported Instance Data to your phone's clipboard. (Do not modify anything as it is checksum protected and modifications will invalidate checksum!)
    See HERE for tutorial
    Code:
    [queen-beecon-header]
    version=1,000000
    checksum=5353938
    [queen-beecon-exported-instance]
    widgetType=0
    operationalStatus=0
    hideCanvas=true
    snippetBgRGB=0
    beecon_lt0_ImgZoom=0
    beecon_lt0_BgRGB=2
    beecon_lt0_ImgFilename=queen-beecon-syserr.png
    beecon_eq0_ImgZoom=0
    beecon_eq0_BgRGB=3
    beecon_eq0_ImgFilename=wc2010mascotte-win.png
    beecon_eq1_ImgZoom=0
    beecon_eq1_BgRGB=4
    beecon_eq1_ImgFilename=wc2010mascotte-tie.png
    beecon_ge2_ImgZoom=0
    beecon_ge2_BgRGB=5
    beecon_ge2_ImgFilename=wc2010mascotte-lose.png
    beecon_idxge2_ImgZoom=0
    beecon_idxge2_BgRGB=11
    beecon_idxge2_ImgFilename=wc2010mascotte-undef.png
    widWidth=402
    widHeight=300
    instanceTitle=Worldcup 2010
    instanceCmd=wget -U "" -t 1 -T 5 -q -O - 'http://m.espn.go.com/soccer/scoreboard?leagueTag=fifa.world&lang=EN' | awk -v fav='Italy' 'BEGIN{FS="";r=3;}/^<\\/style>.+<\\/html>/{match($0,"[\\|] <b  >.+<\\/b> [\\|]");print "<span foreground=\\"yellow\\" font=\\"bold 15\\"> Match<sup>es<\\/sup> on <span foreground=\\"red\\">" substr($0,RSTART+7,RLENGTH-13) "</span></span>";gsub(/(<\\/style>.+<br \\/>)|(<a[^>]*>)|(<[\\/]*div[^>]*>)|(<div class="sec.+$)/,"",$0);x=split($0,m,"(<[^>]*>)");for(i=1;i<x;i++){n=split(m[i],p,"( - )|( [0-9]+-[0-9]+ )|( vs )");if(p[2]==fav||index(p[3],fav)==1){m[i]="<span foreground=\\"green\\" font=\\"bold\\">"m[i]"</span>";if(match(m[i]," [0-9]+\\-[0-9]+ ")){split(substr(m[i],RSTART+1,RLENGTH-1),s,"[ \\-]+");if((p[2]==fav&&s[1]>s[2])||(p[3]==fav&&s[2]>s[1]))r=0;else{if(s[1]==s[2])r=1;else r=2}}}print "  "m[i];}}END{exit r}'; export es="$?"; wget -U "" -t 1 -T 5 -q -O - 'http://m.espn.go.com/soccer/news?section=worldcup2010-index&lang=EN' | awk -v r="$es" -v dt="`date +'%x %r'`" -v oc='white' -v ec='gray' 'BEGIN{FS="";print "<span foreground=\\"cyan\\" font=\\"bold 15\\"> News <span foreground=\\"cyan\\" font=\\"bold 13\\">("dt")</span></span>"}/^<\\/style>.+<\\/html>/{gsub(/(<\\/style>.+>News<\\/div>)|(<[\\/]*a[^>]*>)|(<div[^>]*>)|(<div class="sec.+$)/,"",$0);x=split($0,m,"(<[^>]*>)");for(i=1;i<x;i++){if(i%2==0)c=oc;else c=ec;print "<span foreground=\\""c"\\"> - "m[i]"</span>"}}END{exit r}'
    cmdImgFilename=worldcup.png
    cmdImgZoom=0
    cmdFgRGB=1
    cmdVisibilityPosition=0
    cmdImgVisibilityPosition=5
    cmdJustify=0
    cmdFontName=3
    cmdFontSize=12
    resImgFilename=queen-beecon-resimg.png
    resImgZoom=0
    resFgRGB=1
    resVisibilityPosition=1
    resImgVisibilityPosition=3
    resJustify=0
    resFontName=2
    resFontSize=12
    updOnStartup=false
    updOnClick=true
    updOnDesktop=false
    delayIndex=0
    updNeworkPolicy=1
  5. Proceed with the import of the "Exported Instance Data" according to the following instructions:
    Import Procedure for Beecon Exported Instance Data

And Here we Are!!! But there is one more thing we need to do: Let's change our favourite Team!!!
  1. Let's start the Main Settings Dialog Box Again and click on the "Edit Cmd" button


  2. Let's scroll the command code until we find the following string:

    ... awk -v fav='Italy'

  3. And replace it with our favourite Team

  4. Save changed command with relevant button and "Save and Run" in next dialog!

Have Fun!!!

Data is made available on the internet and is freely accessible also through a normal browser by pointing to m.espn.go.com. 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 Files
File Type: zip 2010-worldcup-images.zip (130.2 KB, 145 views)
__________________
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-06-14 at 08:10.
 

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