Active Topics

 



Notices


Reply
Thread Tools
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 Italian Ringroads Live Traffic



Current Beecon is configured to display Live Traffic graphic status of Milan Ringroads System.

Other major cities in Italy are also available: ROME, TURIN, FLORENCE, NAPLES, BOLOGNA! See relevant section of this thread to adapt the command to different cities.

Let's go...

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. Make sure we copy the following Exported Instance Data to our phone's clipboard. (Do not modify anything as it is checksum protected and modifications will invalidate checksum!)
    Code:
    [queen-beecon-header]
    version=1,000000
    checksum=1248650
    [queen-beecon-exported-instance]
    widgetType=1
    operationalStatus=0
    hideCanvas=false
    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=queen-beecon-appok.png
    beecon_eq1_ImgZoom=0
    beecon_eq1_BgRGB=4
    beecon_eq1_ImgFilename=queen-beecon-appwrn.png
    beecon_ge2_ImgZoom=0
    beecon_ge2_BgRGB=5
    beecon_ge2_ImgFilename=queen-beecon-apperr.png
    beecon_idxge2_ImgZoom=0
    beecon_idxge2_BgRGB=11
    beecon_idxge2_ImgFilename=queen-beecon-index.png
    widWidth=399
    widHeight=400
    instanceTitle=Milan Ringroad Live Traffic Beecon
    instanceCmd=echo "`date`" ; wget --user-agent="" -q -t 1 -T 10 -O "/home/user/MyDocs/.images/queen_beecon_dir/milan-ringroad.gif" "http://traffico.octotelematics.it/dyn/5.gif?ts="
    cmdImgFilename=;queen-beecon.png
    cmdImgZoom=0
    cmdFgRGB=5
    cmdVisibilityPosition=1
    cmdImgVisibilityPosition=1
    cmdJustify=0
    cmdFontName=3
    cmdFontSize=14
    resImgFilename=milan-ringroad.gif
    resImgZoom=1
    resFgRGB=4
    resVisibilityPosition=7
    resImgVisibilityPosition=5
    resJustify=0
    resFontName=3
    resFontSize=12
    updOnStartup=false
    updOnClick=true
    updOnDesktop=false
    delayIndex=0
    updNeworkPolicy=1
  3. Then three usual and basic steps to instantiate the Widget:





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

  5. Click on the "Advanced" button (1)


  6. Confirm that we are PROFESSIONALS and we know what we are doing. Button (1)


  7. We reach the Advanced Settings and Tools Dialog Box... scroll down to the bottom.


  8. We reach following screen. If we press Button (1), we paste our Exported Instance Data into the Import/Export buffer, ready to be processed.


  9. After the Import Buffer is filled with Import Data, let's click on Import Snippet/Beecon Button (1)


  10. And confirm we really want to Import our Instance


  11. SUCCESS!!! We have now imported our Exported Instance.


  12. Let's dismiss the warning and, after imported data is reloaded, we will be back at our Instance Settings Dialog Box. You'll see the new instance data [Buttons (1)(2)(3)(4))
    And we start our newly created Beecon by saving data and running with Button (5)


And Here we Are!!!

We can also access graphics for other Italian Ringroads:
  1. Let's start the Main Settings Dialog Box Again and click on the "Edit Cmd" button (1)


  2. Let's change the command title according to the new City we'd like to retreive traffic status (Text 1)

  3. For ROME change URL in command (Text 2) with: http://traffico.octotelematics.it/dyn/1.gif?ts=
  4. For NAPLES change URL in command (Text 2) with: http://traffico.octotelematics.it/dyn/2.gif?ts=
  5. For FLORENCE change URL in command (Text 2) with: http://traffico.octotelematics.it/dyn/3.gif?ts=
  6. For BOLOGNA change URL in command (Text 2) with: http://traffico.octotelematics.it/dyn/4.gif?ts=
  7. For TURIN change URL in command (Text 2) with: http://traffico.octotelematics.it/dyn/6.gif?ts=
  8. Save changed command with Button (3) 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 "www.octotelematics.it". 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.
__________________
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-10-14 at 10:14.
 

The Following 4 Users Say Thank You to No!No!No!Yes! For This Useful Post:
No!No!No!Yes!'s Avatar
Posts: 700 | Thanked: 846 times | Joined on Nov 2009
#2
Added:

Code:
--user-agent=""
into wget command options to prevent wget from showing himself as bot!
At times, in fact, web server responded with 403 permission denied.
Let's see if this works better now!
__________________
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
 
debernardis's Avatar
Posts: 2,142 | Thanked: 2,054 times | Joined on Dec 2006 @ Sicily
#3
Thanks - I didn't know of this site. It's going to be exceptionally useful...
__________________
Ernesto de Bernardis

 
Posts: 3 | Thanked: 2 times | Joined on Oct 2010
#4
Traffic for Flanders (Belgium)

Hi, I made a similar BeeCon for my own area. Specifities:
  • source page is traffic map
  • A transparent PNG is shown in overlay on a map of the area
  • The image url changes

To overcome these difficulties, an awk script is used, in combination with 2 subsequent wgets. To ease the QBW, I put everything in a shell script. Note: it might be possible to do this more efficiently as I'm a first time user of both awk, shell scripts and QBW

/home/user/.queen_beecon_dir/verkeerskaart.sh (the shell script)
Code:
wget -T 80 -O kaart http://www.verkeerscentrum.be/verkeersinfo/kaart
wget -T 80 -O ~/MyDocs/.images/queen_beecon_dir/map_image.png http://www.verkeerscentrum.be`awk -f verkeerskaart.awk kaart`
ls -l ~/MyDocs/.images/queen_beecon_dir/map_image.png | awk '{ print $8 }'
ls -l ~/MyDocs/.images/queen_beecon_dir/map_image.png | awk '{ print $7,$6 }'
rm -f kaart
/home/user/.queen_beecon_dir/verkeerskaart.awk (the awk script)
Code:
BEGIN { FS = "'" }
/congestions.layer[^_].*'(.map_image.*)/ { print $2 }
now, use the attached picture as a background if you have the marina theme. Otherwise, download from the traffic website and modify to your liking. (note, matching the position of background is a bit tricky. use the supplied background to pinpoint for positioning)

I haven't mastered exporting my QBW yet, but settings are as follows:
type=snippet
result image = map_image.png , size 150%
hide background
size max: 800 x 420.

Custom command:
Code:
cd ~/.queen_beecon_dir
./verkeerskaart.sh
I found it necessary to use the cd, otherwise the picture did not get updated. (It did return the correct date & time though)

Enjoy
Attached Images
  
 

The Following User Says Thank You to sebastiaan.lampo For This Useful Post:
No!No!No!Yes!'s Avatar
Posts: 700 | Thanked: 846 times | Joined on Nov 2009
#5
Originally Posted by sebastiaan.lampo View Post
Traffic for Flanders (Belgium)

Hi, I made a similar BeeCon for my own area. Specifities:
  • source page is traffic map
  • A transparent PNG is shown in overlay on a map of the area
  • The image url changes

To overcome these difficulties, an awk script is used, in combination with 2 subsequent wgets. To ease the QBW, I put everything in a shell script. Note: it might be possible to do this more efficiently as I'm a first time user of both awk, shell scripts and QBW

/home/user/.queen_beecon_dir/verkeerskaart.sh (the shell script)
Code:
wget -T 80 -O kaart http://www.verkeerscentrum.be/verkeersinfo/kaart
wget -T 80 -O ~/MyDocs/.images/queen_beecon_dir/map_image.png http://www.verkeerscentrum.be`awk -f verkeerskaart.awk kaart`
ls -l ~/MyDocs/.images/queen_beecon_dir/map_image.png | awk '{ print $8 }'
ls -l ~/MyDocs/.images/queen_beecon_dir/map_image.png | awk '{ print $7,$6 }'
rm -f kaart
/home/user/.queen_beecon_dir/verkeerskaart.awk (the awk script)
Code:
BEGIN { FS = "'" }
/congestions.layer[^_].*'(.map_image.*)/ { print $2 }
now, use the attached picture as a background if you have the marina theme. Otherwise, download from the traffic website and modify to your liking. (note, matching the position of background is a bit tricky. use the supplied background to pinpoint for positioning)

I haven't mastered exporting my QBW yet, but settings are as follows:
type=snippet
result image = map_image.png , size 150%
hide background
size max: 800 x 420.

Custom command:
Code:
cd ~/.queen_beecon_dir
./verkeerskaart.sh
I found it necessary to use the cd, otherwise the picture did not get updated. (It did return the correct date & time though)

Enjoy
So you managed ... in the end!?!?!?
Watch out however that html page is quite heavy ~125KB + png ~25KB makes 150KB every polling ... maybe there's an equivalent liter page for it by specifying different useragent to wget ... gotta experiment a little bit more though.

Cool beecon indeed!!!
__________________
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
 
Posts: 3 | Thanked: 2 times | Joined on Oct 2010
#6
Originally Posted by No!No!No!Yes! View Post
So you managed ... in the end!?!?!?
Watch out however that html page is quite heavy ~125KB + png ~25KB makes 150KB every polling ... maybe there's an equivalent liter page for it by specifying different useragent to wget ... gotta experiment a little bit more though.

Cool beecon indeed!!!
Yeah, it worked in the end. The key was this cd, as all files simply went to an unknown directory. I noted QBW running from / by default by running "ls" in the test area and went from there...

I never use mobile internet due to charges of 0.5 euro / 5 min in Belgium, so it's only a final check before leaving the home.. but you've got a point there. Also set update to click only.

I'll try out to reduce traffic by using filebeeld.be which is a mobile version of that website (basicly only a trancoder though). If I can get the image url from there, it might save some traffic.
 
Posts: 445 | Thanked: 367 times | Joined on Nov 2010 @ Italy
#7
the website traffico.octotelematics.it now ask for registration?

we need to change the url with an access token or something?

ps: can you make a similar beecon with this real time traffic data from Rome,Italy ? is opendata, updated regularly:
http://85.18.173.117/opendata/UltimoRilevamento.xml

Last edited by gianko; 2013-03-11 at 21:24. Reason: added link
 
Reply

Thread Tools

 
Forum Jump


All times are GMT. The time now is 09:41.