WhiteWolf
|
2010-09-26
, 23:40
|
Posts: 561 |
Thanked: 75 times |
Joined on Jan 2010
@ Spain
|
#651
|
|
2010-09-27
, 06:15
|
|
Posts: 700 |
Thanked: 846 times |
Joined on Nov 2009
|
#652
|
|
2010-09-27
, 06:54
|
|
Posts: 164 |
Thanked: 79 times |
Joined on Jul 2010
|
#653
|
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.
The Beecon statement will return: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}'
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!
|
2010-09-27
, 08:50
|
|
Posts: 700 |
Thanked: 846 times |
Joined on Nov 2009
|
#654
|
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?
wget -t 1 -T 3 -q -O - https://<username>:<password>@mail.google.com/mail/feed/atom --no-check-certificate
The Following User Says Thank You to No!No!No!Yes! For This Useful Post: | ||
|
2010-09-27
, 16:30
|
|
Posts: 164 |
Thanked: 79 times |
Joined on Jul 2010
|
#655
|
|
2010-09-27
, 16:48
|
|
Posts: 968 |
Thanked: 663 times |
Joined on Jun 2010
@ Australia (Melbourne/vic) / Lebanon (Zgharta/north)
|
#656
|
The Following User Says Thank You to elie-7 For This Useful Post: | ||
|
2010-09-27
, 17:23
|
|
Posts: 700 |
Thanked: 846 times |
Joined on Nov 2009
|
#657
|
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.
|
2010-09-28
, 04:50
|
Posts: 44 |
Thanked: 18 times |
Joined on Jul 2008
|
#658
|
[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'
|
2010-09-28
, 06:04
|
Posts: 208 |
Thanked: 220 times |
Joined on Apr 2010
|
#659
|
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.
With Linux-powered N900..ANYTHING is possible
|
2010-09-28
, 06:42
|
Posts: 68 |
Thanked: 19 times |
Joined on Sep 2010
|
#660
|
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:
These values are also updated every time a new internet/network connection is estabilished with the configurations present in the internet connection 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);
In order for wget to properly work behind a proxy, two environment variables must be set in this way:
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:export http_proxy=http://my.proxy.pri:3128/ export https_proxy=http://my.proxy.pri:3128/
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`
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/sbinCode:`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}}'
Change permissions to executable: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 #
and, inside the Beecon, use a shorter statement prepended to wget command:Code:chmod 755 /usr/sbin/pxy.sh
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}}'