[SOLVED]Conky Gmail Script Incorrect

The python gmail script on the arch wik no longer works on python3 or python2 for me. This error is shown in wing:
builtins.ValueError: invalid literal for int() with base 10:
I'm not sure how to fix the incorrect int value, but I would love to see it fixed and posted to the arch wiki again.
#Enter your username and password below within double quotes
# eg. username="username" and password="password"
username="****"
password="****"
com="wget -q -O - https://"+username+":"+password+"@mail.google.com/mail/feed/atom --no-check-certificate"
temp=os.popen(com)
msg=temp.read()
index=msg.find("<fullcount>")
index2=msg.find("</fullcount>")
fc=int(msg[index+11:index2])
if fc==0:
print("0 new")
else:
print(str((fc)+" new"))
Thanks
Last edited by duke11235 (2011-11-21 04:55:28)

Your problem may be with wget.  Try curl:
com = 'curl -s -u "{}:{}" https://mail.google.com/mail/feed/atom'.format( username, password )
The url you are using is for the Gmail RSS feed, and it contains a ':'.  The python urllib.request module that lunar used expects that a port number will follow the ':'. That is why lunar's script is failing for you.
The script I use does not use the RSS feed.  It uses the python IMAP library and connects to imap.gmail.com at port 993.
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
import sys, imaplib
port = 993
server = 'imap.gmail.com'
username = '...'
passwd = '...'
imap_server = imaplib.IMAP4_SSL(server, port)
try:
imap_server.login(username, passwd)
except:
print('?? new')
sys.exit( 1 )
typ, data = imap_server.select ('Inbox', True)
if typ == 'OK':
total = int(data[0])
typ, data = imap_server.search (None, 'SEEN')
if typ == 'OK':
seen = len(data[0].split())
print('{}/{} new'.format(total, total - seen))
if typ != 'OK':
print('?? new')
imap_server.logout()

Similar Messages

  • [SOLVED] Conky, Gmail, and STDOUT Question

    I currently have Conky working with a script to check my gmail (gmail.pl).  It works as intended in conky, but it saves all the output from the script to STDOUT.  This isn't a problem until I log out of openbox and my screen is filled with these things:
    --2008-10-03 09:28:50-- https://<username>:*password*@mail.google.com/mail/feed/atom
    Resolving mail.google.com... 209.85.147.83, 209.85.147.19, 209.85.147.18
    Connecting to mail.google.com|209.85.147.83|:443... connected.
    HTTP request sent, awaiting response... 401 Unauthorized
    Connecting to mail.google.com|209.85.147.83|:443... connected.
    HTTP request sent, awaiting response... 200 OK
    Length: unspecified [text/xml]
    Saving to: `STDOUT'
    [ <=> ] 1,005 --.-K/s in 0s
    2008-10-03 09:28:51 (244 MB/s) - `-' saved [1005]
    It's not really a problem as much as an annoyance I guess.
    What I THINK I would like to do is pipe the output to /dev/null?  Or save it to /dev/null?  I am just not sure how to do this.  I went through the script itself and couldn't figure it out.  Any ideas?  Here is the script:
    #!/usr/bin/perl
    use Switch;
    use Text::Wrap;
    my $what=$ARGV[0];
    $user="<username>"; #username for gmail account
    $pass="<password>"; #password for gmail account
    $file="/tmp/gmail.html"; #temporary file to store gmail
    #wrap format for subject
    $Text::Wrap::columns=65; #Number of columns to wrap subject at
    $initial_tab=""; #Tab for first line of subject
    $subsequent_tab="\t"; #tab for wrapped lines
    $quote="\""; #put quotes around subject
    #limit the number of emails to be displayed
    $emails=4; #if -1 display all emails
    &passwd; #give password the proper url character encoding
    switch($what){ #determine what the user wants
    case "n" {&gmail; print "$new\n";} #print number of new emails
    case "s" { #print $from and $subj for new email
    &gmail;
    if ($new>0){
    my $size=@from;
    if ($emails!=-1 && $size>$emails){$size=$emails;} #limit number of emails displayed
    for(my $i=0; $i<$size; ++$i){
    print "From: $from[$i]\n"; #print from line
    $text=$quote.$subj[$i].$quote."\n";
    print wrap($initial_tab, $subsequent_tab, $text); #print subject with word wrap
    $size=@from;
    if ($emails!=-1 && $size >$emails){print "$emails out of $size new emails displayed\n";}
    case "e" { #print number of new emails, $from, and $subj
    &gmail;
    if($new==0){print "You have no new emails.\n";}
    else{
    print "You have $new new email(s).\n";
    my $size=@from;
    if ($emails!=-1 && $size>$emails){$size=$emails;} #limit number of emails displayed
    for(my $i=0; $i<$size; ++$i){
    print "From: $from[$i]\n"; #print from line
    $text=$quote.$subj[$i].$quote;
    print wrap($initial_tab, $subsequent_tab, $text); #print subject with word wrap
    $size=@from;
    if ($emails!=-1 && $size >$emails){print "$emails out of $size new emails displayed\n";}
    else {
    print "Usage Error: gmail.pl <option>\n";
    print "\tn displays number of new emails\n";
    print "\ts displays from line and subject line for each new email.\n";
    print "\te displays the number of new emails and from line plus \n";
    print "\t\tsubject line for each new email.\n";
    } #didn't give proper option
    sub gmail{
    if(!(-e $file)){ #create file if it does not exists
    `touch $file`;
    #get new emails
    `wget -O - https://$user:$pass\@mail.google.com/mail/feed/atom --no-check-certificate> $file`;
    open(IN, $file); #open $file
    my $i=0; #initialize count
    $new=0; #initialize new emails to 0
    my $flag=0;
    while(<IN>){ #cycle through $file
    if(/<entry>/){$flag=1;}
    elsif(/<fullcount>(\d+)<\/fullcount>/){$new=$1;} #grab number of new emails
    elsif($flag==1){
    if(/<title>.+<\/title>/){push(@subj, &msg);} #grab new email titles
    elsif(/<name>(.+)<\/name>/){push(@from, $1); $flag=0;} #grab new email from lines
    close(IN); #close $file
    sub passwd{ #change to url escape codes in password
    #URL ESCAPE CODES
    $_=$pass;
    s/\%/\%25/g;
    s/\#/\%23/g;
    s/\$/\%24/g;
    s/\&/\%26/g;
    s/\//\%2F/g;
    s/\:/\%3A/g;
    s/\;/\%3B/g;
    s/\</\%3C/g;
    s/\=/\%3D/g;
    s/\>/\%3E/g;
    s/\?/\%3F/g;
    s/\@/\%40/g;
    s/\[/\%5B/g;
    s/\\/\%5C/g;
    s/\]/\%5D/g;
    s/\^/\%5E/g;
    s/\`/\%60/g;
    s/\{/\%7B/g;
    s/\|/\%7C/g;
    s/\}/\%7D/g;
    s/\~/\%7E/g;
    $pass=$_;
    sub msg{
    #THE HTML CODED CHARACTER SET [ISO-8859-1]
    chomp; s/<title>(.+)<\/title>/$1/; #get just the subject
    #now replace any special characters
    s/\&\#33\;/!/g; #Exclamation mark
    s/\&\#34\;/"/g; s/\&quot\;/"/g; #Quotation mark
    s/\&\#35\;/#/g; #Number sign
    s/\&\#36\;/\$/g; #Dollar sign
    s/\&\#37\;/%/g; #Percent sign
    s/\&\#38\;/&/g; s/\&amp\;/&/g; #Ampersand
    s/\&\#39\;/'/g; #Apostrophe
    s/\&\#40\;/(/g; #Left parenthesis
    s/\&\#41\;/)/g; #Right parenthesis
    s/\&\#42\;/*/g; #Asterisk
    s/\&\#43\;/+/g; #Plus sign
    s/\&\#44\;/,/g; #Comma
    s/\&\#45\;/-/g; #Hyphen
    s/\&\#46\;/./g; #Period (fullstop)
    s/\&\#47\;/\//g; #Solidus (slash)
    s/\&\#58\;/:/g; #Colon
    s/\&\#59\;/\;/g; #Semi-colon
    s/\&\#60\;/</g; s/\&lt\;/</g; #Less than
    s/\&\#61\;/=/g; #Equals sign
    s/\&\#62\;/>/g; s/\&gt\;/>/g; #Greater than
    s/\&\#63\;/\?/g; #Question mark
    s/\&\#64\;/\@/g; #Commercial at
    s/\&\#91\;/\[/g; #Left square bracket
    s/\&\#92\;/\\/g; #Reverse solidus (backslash)
    s/\&\#93\;/\]/g; #Right square bracket
    s/\&\#94\;/\^/g; #Caret
    s/\&\#95\;/_/g; #Horizontal bar (underscore)
    s/\&\#96\;/\`/g; #Acute accent
    s/\&\#123\;/\{/g; #Left curly brace
    s/\&\#124\;/|/g; #Vertical bar
    s/\&\#125\;/\}/g; #Right curly brace
    s/\&\#126\;/~/g; #Tilde
    s/\&\#161\;/¡/g; #Inverted exclamation
    s/\&\#162\;/¢/g; #Cent sign
    s/\&\#163\;/£/g; #Pound sterling
    s/\&\#164\;/¤/g; #General currency sign
    s/\&\#165\;/¥/g; #Yen sign
    s/\&\#166\;/¦/g; #Broken vertical bar
    s/\&\#167\;/§/g; #Section sign
    s/\&\#168\;/¨/g; #Umlaut (dieresis)
    s/\&\#169\;/©/g; s/\&copy\;/©/g; #Copyright
    s/\&\#170\;/ª/g; #Feminine ordinal
    s/\&\#171\;/«/g; #Left angle quote, guillemotleft
    s/\&\#172\;/¬/g; #Not sign
    s/\&\#174\;/®/g; #Registered trademark
    s/\&\#175\;/¯/g; #Macron accent
    s/\&\#176\;/°/g; #Degree sign
    s/\&\#177\;/±/g; #Plus or minus
    s/\&\#178\;/²/g; #Superscript two
    s/\&\#179\;/³/g; #Superscript three
    s/\&\#180\;/´/g; #Acute accent
    s/\&\#181\;/µ/g; #Micro sign
    s/\&\#182\;/¶/g; #Paragraph sign
    s/\&\#183\;/·/g; #Middle dot
    s/\&\#184\;/¸/g; #Cedilla
    s/\&\#185\;/¹/g; #Superscript one
    s/\&\#186\;/º/g; #Masculine ordinal
    s/\&\#187\;/»/g; #Right angle quote, guillemotright
    s/\&\#188\;/¼/g; s/\&frac14\;/¼/g; # Fraction one-fourth
    s/\&\#189\;/½/g; s/\&frac12\;/½/g; # Fraction one-half
    s/\&\#190\;/¾/g; s/\&frac34\;/¾/g; # Fraction three-fourths
    s/\&\#191\;/¿/g; #Inverted question mark
    s/\&\#192\;/À/g; #Capital A, grave accent
    s/\&\#193\;/Á/g; #Capital A, acute accent
    s/\&\#194\;/Â/g; #Capital A, circumflex accent
    s/\&\#195\;/Ã/g; #Capital A, tilde
    s/\&\#196\;/Ä/g; #Capital A, dieresis or umlaut mark
    s/\&\#197\;/Å/g; #Capital A, ring
    s/\&\#198\;/Æ/g; #Capital AE dipthong (ligature)
    s/\&\#199\;/Ç/g; #Capital C, cedilla
    s/\&\#200\;/È/g; #Capital E, grave accent
    s/\&\#201\;/É/g; #Capital E, acute accent
    s/\&\#202\;/Ê/g; #Capital E, circumflex accent
    s/\&\#203\;/Ë/g; #Capital E, dieresis or umlaut mark
    s/\&\#204\;/Ì/g; #Capital I, grave accent
    s/\&\#205\;/Í/g; #Capital I, acute accent
    s/\&\#206\;/Î/g; #Capital I, circumflex accent
    s/\&\#207\;/Ï/g; #Capital I, dieresis or umlaut mark
    s/\&\#208\;/Ð/g; #Capital Eth, Icelandic
    s/\&\#209\;/Ñ/g; #Capital N, tilde
    s/\&\#210\;/Ò/g; #Capital O, grave accent
    s/\&\#211\;/Ó/g; #Capital O, acute accent
    s/\&\#212\;/Ô/g; #Capital O, circumflex accent
    s/\&\#213\;/Õ/g; #Capital O, tilde
    s/\&\#214\;/Ö/g; #Capital O, dieresis or umlaut mark
    s/\&\#215\;/×/g; #Multiply sign
    s/\&\#216\;/Ø/g; #Capital O, slash
    s/\&\#217\;/Ù/g; #Capital U, grave accent
    s/\&\#218\;/Ú/g; #Capital U, acute accent
    s/\&\#219\;/Û/g; #Capital U, circumflex accent
    s/\&\#220\;/Ü/g; #Capital U, dieresis or umlaut mark
    s/\&\#221\;/Ý/g; #Capital Y, acute accent
    s/\&\#222\;/Þ/g; #Capital THORN, Icelandic
    s/\&\#223\;/ß/g; #Small sharp s, German (sz ligature)
    s/\&\#224\;/à/g; #Small a, grave accent
    s/\&\#225\;/á/g; #Small a, acute accent
    s/\&\#226\;/â/g; #Small a, circumflex accent
    s/\&\#227\;/ã/g; #Small a, tilde
    s/\&\#228\;/ä/g; #Small a, dieresis or umlaut mark
    s/\&\#229\;/å/g; #Small a, ring
    s/\&\#230\;/æ/g; #Small ae dipthong (ligature)
    s/\&\#231\;/ç/g; #Small c, cedilla
    s/\&\#232\;/è/g; #Small e, grave accent
    s/\&\#233\;/é/g; #Small e, acute accent
    s/\&\#234\;/ê/g; #Small e, circumflex accent
    s/\&\#235\;/ë/g; #Small e, dieresis or umlaut mark
    s/\&\#236\;/ì/g; #Small i, grave accent
    s/\&\#237\;/í/g; #Small i, acute accent
    s/\&\#238\;/î/g; #Small i, circumflex accent
    s/\&\#239\;/ï/g; #Small i, dieresis or umlaut mark
    s/\&\#240\;/ð/g; #Small eth, Icelandic
    s/\&\#241\;/ñ/g; #Small n, tilde
    s/\&\#242\;/ò/g; #Small o, grave accent
    s/\&\#243\;/ó/g; #Small o, acute accent
    s/\&\#244\;/ô/g; #Small o, circumflex accent
    s/\&\#245\;/õ/g; #Small o, tilde
    s/\&\#246\;/ö/g; #Small o, dieresis or umlaut mark
    s/\&\#247\;/÷/g; #Division sign
    s/\&\#248\;/ø/g; #Small o, slash
    s/\&\#249\;/ù/g; #Small u, grave accent
    s/\&\#250\;/ú/g; #Small u, acute accent
    s/\&\#251\;/û/g; #Small u, circumflex accent
    s/\&\#252\;/ü/g; #Small u, dieresis or umlaut mark
    s/\&\#253\;/ý/g; #Small y, acute accent
    s/\&\#254\;/þ/g; #Small thorn, Icelandic
    s/\&\#255\;/ÿ/g; #Small y, dieresis or umlaut mark
    s/^\s+//;
    return $_;
    Last edited by monstermudder78 (2008-10-03 20:34:04)

    The fix was to change conky from:
    ${execi 60 perl ~/scripts/gmail.pl n}
    To:
    ${execi 60 perl ~/scripts/gmail.pl n 2>/dev/null}
    (Added 2>/dev/null, sending the error messages to /dev/null.)
    Last edited by monstermudder78 (2008-10-03 20:37:19)

  • A proposed more secure addition to Conky gmail scripts

    I use conky-cli for my status in DWM; furthermore, I use the gmail python script that has been floating around to check my emails (e.g. http://ubuntu-virginia.ubuntuforums.org … ?t=631157).  It had always bothered me that my password was just sitting there, so today I did something about that.  This method essentially replaces any instance where you are using wget.  It's a simple c script which uses libcurl.  Once compiled your password is not just there in plain text, and it's basically a drop in replacement for whatever wget command you are using.
    #include <stdio.h>
    #include <curl/curl.h>
    int main(void)
    CURL *curl;
    CURLcode res;
    curl=curl_easy_init();
    if (curl)
    curl_easy_setopt(curl, CURLOPT_URL, "https://USER:[email protected]/mail/feed/atom");
    curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L);
    curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0L);
    res=curl_easy_perform(curl);
    curl_easy_cleanup(curl);
    return 0;
    Compile it with gcc and the -lcurl flag.
    I don't know exactly how useful this is to anyone.  I am sure someone else has a better solution, but this was quick and easy for me.
    Thanks.

    measure wrote:Thank you for making the effort to create this; it is impressive.  The obvious question: is there any way around it?
    It's not terribly impressive; I thought of using LD_PRELOAD to attack your program while reading the fakeroot man page, confirmed that the attack would work with:
    su -c chmod go-r /usr/bin/id
    fakeroot id
    su -c chmod go+r /usr/bin/id
    and then cranked out the easiest attack I could think of using LD_PRELOAD.
    No, there is no way around this general class of attack.
    measure wrote:The only fault I can see is that you had to know ahead of time I was using curl_easy_setopt to sneak in.  This of course isn't much of a fault, as a truly secure system should be public.  I know very little about C, but I would imagine there are ways around this.  Is there no way in C to make sure that I am using the curl_easy_setopt in curl/curl.h ?  If this can be done, then your exploit can be accounted for.
    curl_easy_setopt is not 'in' curl/curl.h; curl/curl.h is a header file, and only contains the function prototype.  The actual code of curl_easy_setopt is in libcurl.so (roughly speaking; actually, libcurl.so itself is a symlink to a symlink to the shared library itself).
    As for having to know you were using curl_easy_setopt: replacing that function was just the quickest attack I could code up, given that I had your program's source code.  As I mention in my README, a real attacker would go looking for a pre-prepared shared object and wrapper tool that would dump out all of the target program's code and data from the shared object's startup code (it's not hard; just dump the page containing the program's main function, then dump out the pages before and after that one until SIGSEGV happens).  I would be very surprised if such a tool isn't already widely available.
    measure wrote:Either way though, thank you again for going out of your way to do this.  I really appreciate it.
    I didn't notice the before-and-after times, but I think it took less than fifteen minutes to implement the attack after I saw the reference to LD_PRELOAD in the fakeroot documentation. 
    measure wrote:As you seem to be a creative programmer, here's a challenge (which also somehow selfishly allows me to not learn any C, but get results...hmmm) which may or may not actually be a challenge: can I indeed get the desired information about the curl_easy_setopt I am using? Or any of the functions I use for that matter, I suppose I'd have to be more careful with all of them.  And suppose I could fix this, are there other ways to exploit it?
    By 'the desired information about the curl_easy_setopt [you are] using', I assume you mean 'which library's curl_easy_setopt am I using?'.  The answer is no, and the glibc dynamic linker goes to some trouble to keep you from finding that out.  Even if you could, some code in the shared object would run before your program's main function, and that could easily dump out the sensitive areas of your address space.
    measure wrote:I ask this not because I think someone wants to steal my email address.  This is of course just out of curiosity at this point; but I appreciate your enthusiasm none-the-less.
    The best solution is writing a daemon, and feeding it your password at startup through a pipe.  I don't think you'll be able to do that yourself at the moment; little things like error handling become both more important and trickier to implement properly.
    Making your program setuid would keep LD_PRELOAD attacks like mine from working (because ld.so can detect that a program is setuid, and takes some precautions to block the obvious privilege escalation holes), but I don't know whether libcurl has a similar 'feature'.  (If you must do this, make its owner a special account that is not used for any other purpose; do *not* use the 'nobody' account for this program.)

  • [solved] "what's my linux doing?" conky-bar + script?

    Hi!
    I'm searching for and/or am trying to figure out a conky config + script that lets me "sort of see what my pc is doing atm", just a little peek, something that "helps guess" and "blends in". Couldn't find anything that lets me see some random details like that, so I did this for now:
    stuff.bash:
    #!/bin/bash
    touch stuff.1 stuff.2
    ps -A -o "cmd" > stuff.x
    #pstree -U > stuff.x
    if [ "$(diff -q stuff.x stuff.1)" = "" ]; then
    cat stuff.diff
    else
    mv -b stuff.1 stuff.2
    mv -b stuff.x stuff.1
    diff --suppress-common-lines -d stuff.1 stuff.2 | grep \< | tr '\n' ' ' | sed "s/^[0-9a-f ]*//" > stuff.diff
    cat stuff.diff
    fi
    which I'm using in that conky bar:
    own_window yes
    own_window_type dock
    own_window_title conky
    own_window_colour 555577
    background yes
    double_buffer true
    use_xft yes
    xftfont DejaVu Sans Mono:style=Bold:size=12
    alignment top_middle
    border_width 0
    gap_x 0
    gap_y 0
    minimum_size 1950 20
    maximum_width 1950 20
    use_spacer left
    color0 aa8888
    color1 white
    color2 grey
    draw_borders no
    draw_outline no
    draw_shades no
    short_units yes
    top_name_width 8
    pad_percents 2
    cpu_avg_samples 12
    net_avg_samples 12
    update_interval 1
    TEXT
    ${color0}${font impact}CPU:${font} ${color1}${cpu cpu1}% / ${cpu cpu2}% \
    ${color2}(${TOP name 1} | ${TOP name 2} | ${TOP name 3}) \
    ${color0}${font impact}MEM:${font} ${color1}${memperc}% \
    ${color2}(${TOP_mem name 1} | ${TOP_mem name 2} | ${TOP_mem name 3}) \
    ${color0}${font impact}DO:${font} ${color1}${downspeed wlan0} ${color0}${font impact}UP:${font} ${color1}${upspeed wlan0} \
    ${color0}${font impact}LAST: ${color2}${font} ${scroll 92 3 ${exec "~/stuff.bash"}}\
    ${alignr}\
    ${color1}${time %A, %Y-%m-%d - %H:%M:%S Uhr}\
    So... that gives me a sort of nice conky bar with some random "what's being done" - now p.e. It tells me that yaourt is calling wget and pacman... and cmake has been started... and for some reason firefox is calling itsself... and some strange python script in /tmp/... with my home directory written behind it as parameters... mmmh... well.... maybe I should check on that later, so back to the topic - what I'm sort of missing is more or less...:
    (edit: [solved] / -I would rather have done something like this with lsof, but I didn't manage to get rid of some of the constantly changing columns of lsof output - those lead to way too many reoccurring info's and doesn't give me the feeling of "a little peek behind the curtains" like it's supposed to be )
    - There must be an overall better ways to do something like that, right? Any ideas for a smart little script that gets a few lines of "chaotic random backgrund info" with a good: "ooooh, I seeee"-ratio and not too much spam?
    (edit: [solved] - "network stuff"! I can't see enough network stuff!!! So if anyone knows an easy (easy as in "call-it-once-per-5-seconds-with-concy"-easy) to show what processes are meddling around on the network most atm, that would be great... maybe I'll try netstat again for just that... )
    - Also the whole rest of that config & script are far from perfect...
    So: Any hints & stuff? Thanks!
    Last edited by whoops (2009-07-19 11:12:24)

    Ooooh, that explains it.
    Thanks, but I'm looking for (see example) a single line or something for a conky bar and something a lot less "systematic"... hard to explain... something to "see stuff fly by"... the "strange small line where I can recognize stuff from time to time"... like at the moment it's telling me "kjournal2d  < n/usr/libhistory < bla bla bla < www.archlinux.org < ninotify < npipe < npipe < /bin/bash ./stuff.bash < /dev/input event....." and its going on an on and on which does not make thaaat much sense for but I like seeing it...
    That's my "best one" so far:
    stuff.bash:
    #!/bin/bash
    touch stuff.1 stuff.2
    ps -A -o "cmd" > stuff.x
    lsof -F cn | grep -v -E "p[0-9][0-9]|proc|stuff|lsof|grep|conky| sed " | sed "s/^.//g" >> stuff.x
    diff -BEbw --suppress-common-lines stuff.x stuff.1 | grep \< | tr '\n' ' ' | sed "s/^[0-9a-f ]*\|IPv4//g" | sed "s/ */ /g" > stuff.diffx
    if [ "$(diff stuff.diffx stuff.diff | grep \<)" = "" ]; then
    cat stuff.diff
    else
    mv -b stuff.1 stuff.2
    mv -b stuff.x stuff.1
    mv -b stuff.diffx stuff.diff
    cat stuff.diff
    fi
    ... just I think it might suck a little too much CPU... and I didn't manage to filter out all the stuff this script generates itself without loosing too many unrelated info... and some stuff that keeps showing up every few seconds. Somehow I'd like it mostly to show "stuff that doesn't happen all the time".
    Last edited by whoops (2009-07-19 11:09:23)

  • [SOLVED] (Perl) Help Modifying Conky Weather Script

    I'm using buttons' excellent Conky weather script, but it has more information than I need. It displays both the current weather condition and the temperature:
    [condition]:[temperature]F
    so right now it's
    Clear: 46F
    All I need is for it to display the temperature, without the current condition, colon, and letter 'F' (for Fahrenheit).
    the script:
    METRIC=0 #Should be 0 or 1; 0 for F, 1 for C
    if [ -z $1 ]; then
    echo
    echo "USAGE: weather.sh <locationcode>"
    echo
    exit 0;
    fi
    curl -s http://rss.accuweather.com/rss/liveweather_rss.asp\?metric\=${METRIC}\&locCode\=$1 | perl -ne 'if (/Currently/) {chomp;/\<title\>Currently: (.*)?\<\/title\>/; print "$1"; }'
    In Conky:
    {execi 300 /home/hex/.conky/weather.sh <zip code>}
    I'm not familiar with Perl yet so any help is much appreciated
    Last edited by Olson (2011-02-17 07:06:10)

    Try this
    curl ... | perl -ne 'if (/Currently/) {chomp;/\<title\>.*: (\d*).\<\/title\>/; print "$1"; }'

  • I had a power failure 2 days ago, have power now, but cannot send email from my iPad. Everything was fine before that. The box says cannot send mail, the user name or password for Gmail is incorrect. I haven't changed anything. I need help. Thanks

    Hi
    I had a power failure 2 days ago, my computer is running again, but now I cannot send email from my iPad using Cox or my gmail account. I am receiving mail in my Cox account but not my gmail account.It was working fine until the power failure. It keeps telling me, the user name or password for Gmail is incorrect. I have not changed anything. I don't know what is wrong. Can anyone help me? Thanks

    I agree, unplug and replug your router, then reset your iPad by holding down the sleep and home buttons, ignore the red power down slider, and wait til you see the silver apple. let it reboot and then try your connection.
    Chances are rebooting the router will help. You may also need to talk to cox. They may need to reset something on their end.

  • Gmail on iphone was working fine until yesterday when it prompted me with the message cannot get mail user name or password for gmail is incorrect, i have tried deleting the account and re-created a new account, same problem, can anyone help?

    gmail on iphone was working fine until yesterday when it prompted me with the message "cannot get mail user name or password for gmail is incorrect", i have tried deleting the account and re-created a new account, same problem, can anyone help?

    paulcb, you're a genius, it worked, thank you so much, you don't know how much stress you have taken off my shoulders, I am constantly on my email in my iphone everyday.  Thanks a million, take care. Robert.

  • TS2621 when I tried to access my mailbox I get the message "The user name or password for Gmail is incorrect"    I don't see an error.

    Why would I get a message saying "The user name or password for Gmail is incorrect" when I see no error?

    paulcb, you're a genius, it worked, thank you so much, you don't know how much stress you have taken off my shoulders, I am constantly on my email in my iphone everyday.  Thanks a million, take care. Robert.

  • On my iPhone 5 I am having a problem sending / receiving e-mails and am receiving the message: the user name or password for "imap.gmail" is incorrect. Despite many attempts I am getting nowhere. Does anyone recognise this problem?

    I am having a problem sending/receiving e mail messages on my iPhone 5 and cannot access my account. The message I am receiving is: The user name or password for "imap.gmail" is incorrect.
    I do not know what imap.gmail is. I have also lost data which was contained on my diary which I believe is linked to the problem. Does anyone recognise this problem?
    Cheers,
    Morred

    Morred wrote:
    I am having a problem sending/receiving e mail messages on my iPhone 5 and cannot access my account. The message I am receiving is: The user name or password for "imap.gmail" is incorrect.
    I do not know what imap.gmail is. I have also lost data which was contained on my diary which I believe is linked to the problem. Does anyone recognise this problem?
    Cheers,
    Morred
    imap.gmail is the Google mail server. It doesn't recognize the password that is stored in the iPhone. The problem is that the password or email address you have in Settings for the gmail account is wrong. If you changed the password somewhere else that is the reason. You need to go to Settings/Mail,Contacts,Calendar, tap on the gmail account and enter the correct password. You also need to change it for outgoing mail in Settings.

  • TS3058 Cannot Get Mail The user name or password for "gmail" is incorrect.

    Cannot Get Mail
    the user name or password for "gmail" is incorrect.

    did you do this
    http://support.google.com/mail/bin/answer.py?hl=en&answer=77702
    http://echeng.com/journal/2010/04/05/how-to-properly-set-up-gmail-with-your-ipad /

  • Why is my mail saying "cannot get mail - user name or password for Gmail is incorrect" but on the Gmail app there is no problem.  I have checked the settings and everything seems to be ok

    Why is my mail saying "cannot get mail - user name or password for Gmail is incorrect" but on the Gmail app there is no problem.  I have checked the settings and everything seems to be ok

    Go here and unlock your account... https://www.google.com/accounts/DisplayUnlockCaptcha

  • The user name or password for gmail is incorrect.  They are correct. How do I fix it?

    When I try to get mail, it says. "username or password for gmail is incorrect". I didn't change anything and they are correct. How do I fix it?  iPod touch 3 g

    I google 'google captcha' every time but here is the link  www.google.com/accounts/DisplayUnlockCaptcha
    captcha is when you have to type in the characters or word that is written in a funny font.  It is some sort of test to make sure you are a real person and not just another computer.

  • And I keep getting messages that " the username or password for imap.gmail is incorrect

    I Have a new I pad and I cannot set up email. I tried 2 different emails and I keep getting messages that " the username or password for imap.gmail is incorrect. What am I doing wrong?

    I would delete the accounts and start all over again making sure to follow the instructions here.
    http://support.apple.com/kb/ht4810
    Sometimes, you have to go deeper into the settings and check the outgoing mail server setting as well, especially, if you cannot send mail.
    Settings>Mail, Contacts, Calendars>Your email account>Account>Outgoing mail server - tap the server name next to SMTP and check in the primary server and make sure your username and password are entered and correct - even if it says that the password is optional

  • GMail.  Changed password on PC email account, and did same on IPhone 4 Settings for Gmail.  App opens but tells me username or password for Gmail is incorrect.  Have ensured both are correct...still no access

    GMail.  Changed password on PC email account, and did same on IPhone 4 Settings for Gmail.  App opens but tells me username or password for Gmail is incorrect.  Have ensured both are correct...still no access

    If you have 2-step verification set up for your gmail account, you will need to generate an application-specific password for your iphone applications (because those apps apparently don't support 2-step verification).
    Go into your google account, look in accounts/security/2-step verification, there is a link called "Manage your application specific passwords"   Use that to generate a special password for your iphone apps and use that instead of your usual gmail password on your phone.

  • IMac indicating Password for Gmail is incorrect but iPhone and iPad are both able to connect to gmail account....how do I correct this on the iMac?

    iMac indicating Password for Gmail is incorrect but iPhone and iPad are both able to connect to gmail account....how do I correct this on the iMac?

    Try This:
    Open up the imessage app on your Imac.  Once you have it opened go to top left corner of your screen next to the apple picture and the word MESSAGES appears. Click on it then click on preferences and uncheck your husbands phone and number and or any other numbers which are checked. I had same problem this fixed it. Also if you wanted to you can open up your own Apple account, but that's not really necessary. My wife and I both share the same as you do

Maybe you are looking for