Notices


Reply
Thread Tools
Posts: 561 | Thanked: 75 times | Joined on Jan 2010 @ Spain
#651
Since this tool can enable GPS to get coordinates?
 
No!No!No!Yes!'s Avatar
Posts: 700 | Thanked: 846 times | Joined on Nov 2009
#652
Originally Posted by WhiteWolf View Post
Since this tool can enable GPS to get coordinates?
By itself QBW does not have any GPS management code.
I suggest having a look to first search results here:
http://www.google.it/search?q=maemo+5+liblocation+api
for some tips on writing helper in C/Python

Dunno of any simpler method but maybe could be added in one of the next QBW releases.
I'll check feasibility and effort.

Ciao.
__________________
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
 
PathFinder@9GS's Avatar
Posts: 164 | Thanked: 79 times | Joined on Jul 2010
#653
Originally Posted by No!No!No!Yes! View Post

GMail New Messages Notifier Beecon
Following Beecon retrieves number of unread messages in specified Gmail Inbox.
Substitute <username> and <password> with your personal account information.
Code:
wget -t 1 -T 3 -q -O - https://<username>:<password>@mail.google.com/mail/feed/atom --no-check-certificate | awk 'BEGIN{m=2}/<fullcount>.+<\/fullcount>/{gsub(/<[^>]*>/,"",$0);print $1 " New";if($1>0)m=1;else m=0}END{exit m}'
The Beecon statement will return:
Exit Status 0 (Green Beecon) for 0 New Mails
Exit Status 1 (Yellow Beecon) for >0 New Mails
Exit Status 2 (Red Beecon) for problems fetching Mails
Exit Status -1 (Grey Beecon) for System problems

For PROXY/WGET related info have a look at THIS post

Ciao, No!No!No!Yes!
OKay so i have been using this app since a longg time now and because recently my email app finally gave up on me :P
and there being no other app as far as email goes, i decided to use qbw for the notifications

But when I use this code , it always exits with code 2. I have checked the username and password many times but it just wont run.
Can you please help me identify the problem?
 
No!No!No!Yes!'s Avatar
Posts: 700 | Thanked: 846 times | Joined on Nov 2009
#654
Originally Posted by PathFinder@9GS View Post
OKay so i have been using this app since a longg time now and because recently my email app finally gave up on me :P
and there being no other app as far as email goes, i decided to use qbw for the notifications

But when I use this code , it always exits with code 2. I have checked the username and password many times but it just wont run.
Can you please help me identify the problem?
Tested right now and it works.
<username> must be without @gmail.com
Try
Code:
wget -t 1 -T 3 -q -O - https://<username>:<password>@mail.google.com/mail/feed/atom --no-check-certificate
and see what kind of output you get.
__________________
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
 

The Following User Says Thank You to No!No!No!Yes! For This Useful Post:
PathFinder@9GS's Avatar
Posts: 164 | Thanked: 79 times | Joined on Jul 2010
#655
seems like there ws problem when i copied the command..
works flawlessly now..
Thanks a lot and keep up the good work
 
elie-7's Avatar
Posts: 968 | Thanked: 663 times | Joined on Jun 2010 @ Australia (Melbourne/vic) / Lebanon (Zgharta/north)
#656
best widget ever, now a couple of questions, please be patient with me, i'm a noob, and this is my favorite thing on the n900 .
1-i made a queen becon widget that opens a google page when clicked, but, by mistake, i checked the update @desktop thing, and now every time i go back to the desktop it opens a google page, how can i remove that googel thing (unistalling/reinstallin didn't work ), because now my favorite widget is unistalled, and when installed i can't go to the desktop!!
2- can i get a command to check status update from a facebook friend, or something from twitter ???
and whats the command to display rss feeds ????
3- i know about the eauropean football thing, but can i just get the command that displays the results from the england league (i like fixing the widget my self) without the images and all that... just the display command .
4-i know about the launch the phone application command, is there wone to lunch the dialer ???
5-now here is the big one, can we turn this to a google search widget, where we can write the serch subject in a box insdide the widget, and hit the search button ??? kind of like on android .

this is the best widget on all mobile devices, and please be patient with me.
__________________
rolling down the street, smoking ENDO, sipping on gin and juice
laid back, with my mind on my money and my money on my mind .
 

The Following User Says Thank You to elie-7 For This Useful Post:
No!No!No!Yes!'s Avatar
Posts: 700 | Thanked: 846 times | Joined on Nov 2009
#657
Originally Posted by elie-7 View Post
best widget ever, now a couple of questions, please be patient with me, i'm a noob, and this is my favorite thing on the n900 .
1-i made a queen becon widget that opens a google page when clicked, but, by mistake, i checked the update @desktop thing, and now every time i go back to the desktop it opens a google page, how can i remove that googel thing (unistalling/reinstallin didn't work ), because now my favorite widget is unistalled, and when installed i can't go to the desktop!!
See here but change updOnDesktop instead of updOnStartup

Originally Posted by elie-7 View Post
2- can i get a command to check status update from a facebook friend, or something from twitter ???
and whats the command to display rss feeds ????
Sorry, can't help here

Originally Posted by elie-7 View Post
3- i know about the eauropean football thing, but can i just get the command that displays the results from the england league (i like fixing the widget my self) without the images and all that... just the display command .
See Here; last one is England

Originally Posted by elie-7 View Post
4-i know about the launch the phone application command, is there wone to lunch the dialer ???
See Here; phone application is: rtcom-call-ui

Originally Posted by elie-7 View Post
5-now here is the big one, can we turn this to a google search widget, where we can write the serch subject in a box insdide the widget, and hit the search button ??? kind of like on android .
Definitely can't input content inside widget ... there's already a google search widget, i suppose.

Originally Posted by elie-7 View Post
this is the best widget on all mobile devices, and please be patient with me.
10x
__________________
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
 

The Following 2 Users Say Thank You to No!No!No!Yes! For This Useful Post:
Posts: 44 | Thanked: 18 times | Joined on Jul 2008
#658
Can someone take a look at this and tell me what I'm doing wrong? Everything pretty much works, except that when I use the widget to turn Off wifi, the button goes dark as expected but then pops back to On (exit code 1?)... wifi shuts down correctly, though, so it isn't really an issue, just something unexpected happening that I'm not sure how to fix.

There's some disabled dbus-monitoring code in there that I wanted to implement for setting the button to off (for when going out of wifi range or auto-disconnect taking down the wlan), but then I realized programs can bring up the connection too, so I just set it to update the status of the button @desktop... workaround, but whatever.

Code:
[queen-beecon-header]
version=1.000000
checksum=5509570
[queen-beecon-exported-instance]
widgetType=0
widgetVisible=1
operationalStatus=0
hideCanvas=true
hideClickCanvas=true
snippetBgRGB=0
snippetExtBgRGB=#000000000000
beecon_lt0_ImgZoom=0
beecon_lt0_BgRGB=2
beecon_lt0_ExtBgRGB=#808080808080
beecon_lt0_ImgFilename=
beecon_eq0_ImgZoom=1
beecon_eq0_BgRGB=3
beecon_eq0_ExtBgRGB=#0000ffff0000
beecon_eq0_ImgFilename=off-button.png
beecon_eq1_ImgZoom=1
beecon_eq1_BgRGB=4
beecon_eq1_ExtBgRGB=#ffff00000000
beecon_eq1_ImgFilename=on-button.png
beecon_ge2_ImgZoom=0
beecon_ge2_BgRGB=5
beecon_ge2_ExtBgRGB=#000000000000
beecon_ge2_ImgFilename=
beecon_idxge2_ImgZoom=0
beecon_idxge2_BgRGB=11
beecon_idxge2_ExtBgRGB=#ffffffffffff
beecon_idxge2_ImgFilename=
widWidth=90.085043988269803
widHeight=90.411764705882348
instanceTitle=Wifi
instanceCmd=if [ "_$QBW_EXEC_REASON" == "_QBW_STARTUP_UPDATE" ];
then\nif [ "_$QBW_IS_CONNECTED" == "_true" ]; then\n  echo "ON";\n
exit 1;\nelse\n  echo "OFF";\n  exit 0;\nfi;\nfi;\n\nif [
"_$QBW_EXEC_REASON" == "_QBW_DESKTOP_SWITCH" ]; then\nif [
"_$QBW_IS_CONNECTED" == "_true" ]; then\n  echo "ON";\n  exit
1;\nelse\n  echo "OFF";\n  exit 0;\nfi;\nfi;\n\nif [
"_$QBW_CURRENT_RESULTS_TEXT" == "_OFF" ]; then\n    dbus-send --system
--type=method_call --dest=com.nokia.icd /com/nokia/icd
com.nokia.icd.connect string:"[ANY]" uint32:0;\n  echo "ON";\n  exit
1;\nfi;\n\nif [ "_$QBW_CURRENT_RESULTS_TEXT" == "_ON" ]; then\n
dbus-send --system --dest=com.nokia.icd /com/nokia/icd_ui
com.nokia.icd_ui.disconnect boolean:true;\n  echo "OFF";\n  exit
0;\nfi;
rememberMe=
cmdImgFilename=queen-beecon.png
cmdImgAngle=0
cmdImgZoom=0
cmdFgRGB=1
cmdExtFgRGB=#ffffffffffff
cmdTextAngle=0
cmdVisibilityPosition=0
cmdImgVisibilityPosition=0
cmdJustify=0
cmdExtFont=Nokia Sans bold italic 12
cmdFontName=3
cmdFontSize=12
resImgFilename=queen-beecon-resimg.png
resImgAngle=0
resImgZoom=0
resFgRGB=1
resExtFgRGB=#ffffffffffff
resTextAngle=0
resVisibilityPosition=0
resImgVisibilityPosition=5
resJustify=0
resExtFont=Nokia Sans bold 12
resFontName=2
resFontSize=12
progressAnimationFrames=0
progressAnimationTimer=4
progressAnimationPos=4
progressAnimationAtClickXY=false
progressAnimationBasename=queen-beecon-progress
updOnStartup=true
updOnClick=true
updOnDesktop=true
updOnSight=false
delayIndex=0
customIntervalSecs=0
updNeworkPolicy=0
updOnDBUS=0
updOnDBUSBus=0
updOnDBUSMatchRule=type='signal',path='/com/nokia/wlancond/signal',interface='com.nokia.wlancond.signal',member='disconnected',arg0='wlan0'
edit: I'm not sure how to write the command without the new lines, either... i tried fixing it with ;'s as nononoyes mentioned, but then the widget just gave me error code 2... massive failure. It looks alright in the command buffer, just export changes them all into /n's, which is as expected but still kinda annoying

Last edited by IcyAirs; 2010-09-28 at 04:52. Reason: explanation
 
Posts: 208 | Thanked: 220 times | Joined on Apr 2010
#659
Originally Posted by IcyAirs View Post
Can someone take a look at this and tell me what I'm doing wrong? Everything pretty much works, except that when I use the widget to turn Off wifi, the button goes dark as expected but then pops back to On (exit code 1?)... wifi shuts down correctly, though, so it isn't really an issue, just something unexpected happening that I'm not sure how to fix.
Couldn't import the code,getting a g_key_file_load_data error.Maybe you could export and upload again.Also why use underscores at beginning,don't think that's necessary.
__________________
With Linux-powered N900..ANYTHING is possible
 
Posts: 68 | Thanked: 19 times | Joined on Sep 2010
#660
Originally Posted by No!No!No!Yes! View Post
I quote a previous post to clarify some possible issues with respect to the use of wget to retreive webpages to be parsed for relevant contents.

Proxy support in N900 Maemo (don't know for previous versions) is far from being perfect and comfortable to handle.

While testing the previous Beecon behind our company's firewall, hildon-home/desktop got frozen because of the wget command trying to access internet resources while being blocked by our firewall.

Only way to unfreeze it was to kill both the shell script spawned by Beecon, awk and wget hung processes.

UPDATE 201002251730{Don't know why wget hung itself like this in endless timeout but} Setting -t 1 -T 3 options prevents wget from hanging and getting stuck for more then -T 3 seconds even if connection or proxy problems arise!!! However set -T <secs> according to the foreseen size of the web content to be fetched
I figured out a way to programmatically retrieve the proxy settings both for HTTP and for HTTPS from the internal MicroB browser configuration file: /home/user/.mozilla/microb/prefs.js

File holds several values related to proxy settings:
Code:
user_pref("network.proxy.http", "my.proxy.pri");
user_pref("network.proxy.http_port", 3128);
user_pref("network.proxy.no_proxies_on", "");
user_pref("network.proxy.ssl", "my.proxy.pri");
user_pref("network.proxy.ssl_port", 3128);
user_pref("network.proxy.type", 1);
These values are also updated every time a new internet/network connection is estabilished with the configurations present in the internet connection settings.


In order for wget to properly work behind a proxy, two environment variables must be set in this way:
Code:
export http_proxy=http://my.proxy.pri:3128/
export https_proxy=http://my.proxy.pri:3128/
Following one-liner script, which must be prepended to the wget command, does exactly that. It parses the MicroB/Browser configuration file and generates the statements to dynamically set those two variables:

Code:
`awk 'BEGIN {FS="[\(\", ;\)]+"}/proxy\.http"/{hx=$3}/proxy\.http_port"/{hp=$3}/proxy\.type"/{pt=$3}/proxy\.ssl"/{sx=$3}/proxy\.ssl_port"/{sp=$3}END{if(pt==0)exit;print "export http_proxy=http://" hx ":" hp "\/ export https_proxy=http://" sx ":" sp "\/"}' /home/user/.mozilla/microb/prefs.js`
So the final statement to feed the MLB Beecon with, will be this one:
Code:
`awk 'BEGIN {FS="[\(\", ;\)]+"}/proxy\.http"/{hx=$3}/proxy\.http_port"/{hp=$3}/proxy\.type"/{pt=$3}/proxy\.ssl"/{sx=$3}/proxy\.ssl_port"/{sp=$3}END{if(pt==0)exit;print "export http_proxy=http://" hx ":" hp "\/ export https_proxy=http://" sx ":" sp "\/"}' /home/user/.mozilla/microb/prefs.js`;wget -t 1 -T 3 -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}}'
Of course you can save the proxy variables builder command into a file system shell script, lets say: pxy.sh and drop it into some PATH-reachable directory ex. /usr/sbin
Code:
# cat /usr/sbin/pxy.sh

awk '
BEGIN {
   FS="[\(\", ;\)]+"
}

/proxy\.http"/ { hx=$3 }
/proxy\.http_port"/ { hp=$3 }
/proxy\.type"/ { pt=$3 }
/proxy\.ssl"/ { sx=$3 }
/proxy\.ssl_port"/ { sp=$3 }

END {
   if ( pt==0 ) exit;
   print "export http_proxy=http://" hx ":" hp "\/ export https_proxy=http://" sx ":" sp "\/"
} ' /home/user/.mozilla/microb/prefs.js

#
Change permissions to executable:
Code:
chmod 755 /usr/sbin/pxy.sh
and, inside the Beecon, use a shorter statement prepended to wget command:
Code:
`pxy.sh` ; wget -t 1 -T 3 -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}}'
Thank you for your amazing widget, not only has it improved my N900 it has also made me more interested in command lines etc. one of the ways your program may be able to help me is with the many apps that will not work with 3G +proxy. take the groove app for example, a fine app on wi-fi but no go on my 3g + proxy. is there a way I can use queen beecon widget to launch such apps when I am not able to connect to wi-fi, possibly related to your above posting.
Thanks again and keep up the excellent work.
 
Reply


 
Forum Jump


All times are GMT. The time now is 23:39.