Page 4 of 47 FirstFirst ... 2345614 ... LastLast
Results 31 to 40 of 467

Thread: Conky Google Calendar Python Script

  1. #31
    Join Date
    Feb 2008
    Location
    52°38'41.6"N/1°19'43.6"E
    Beans
    Hidden!

    Re: Conky Google Calendar Python Script

    Quote Originally Posted by martynp View Post
    Hi,

    Confirming the new script installed. Formatting (ie datatype) working fine but everything is still getting doubled up.

    As I am watching I have 6 unread items in 5 feeds.

    The script is showing 12 unread items in 10 feeds.

    I have it refreshing every 60 seconds and am refreshing google reader AND grNotify at the same time to ensure accuracy.

    See the attached screenshot and note the unread feed count in grNotify in the system tray. This is the correct number.

    Martyn
    I think it might have something to do with the user entries, e.g. in your xml there are several entries like this:

    Code:
    user/06078103049471248256/label/News
    They seem to be user defined categories. So when the script is counting the totals up, it is doing so based on the feeds and the categories, hence the doubling up. The reason I didn't get this problem is 'cause I don't have any categories defined.

    New script attached which ignores the user category counts for now, let me know whether the results are good now

    Fingers crossed!

    Edit: If this doesn't work you're going to have to PM me your feeds xml, just paste this into your browser to get it: https://www.google.com/reader/api/0/...count?all=true
    Attached Files Attached Files
    Last edited by kaivalagi; July 11th, 2008 at 06:03 PM.

  2. #32
    Join Date
    Jun 2007
    Beans
    97

    Re: Conky Google Calendar Python Script

    Hi,

    Appears to work like a charm!!!

    I'll monitor for a few hours and let you know if any problems!

    Thanks you soooooooo much!

  3. #33
    Join Date
    Jun 2008
    Location
    imjscn
    Beans
    130

    Question Re: Conky Google Calendar Python Script

    Is it possible to use Conky and your google api tech to get any information from any website?
    I wish to get this public calenda in Conky:
    http://www.forexfactory.com/calendar.php?

  4. #34
    Join Date
    Feb 2008
    Location
    52°38'41.6"N/1°19'43.6"E
    Beans
    Hidden!

    Re: Conky Google Calendar Python Script

    Quote Originally Posted by imjscn View Post
    Is it possible to use Conky and your google api tech to get any information from any website?
    I wish to get this public calenda in Conky:
    http://www.forexfactory.com/calendar.php?
    Currently it only handles your primary calendar in google, and it will never handle any calendar data not within the google umbrella as it were.

    It may be possible to source calendar data from a public google calendar instead of your own, but it will require investigation before I can say yes for certain.

    The calendar you are referencing looks like it's a custom one created for that website which will not work at all with the gdata api used in my script. However if you can find a google public calendar which represents that link then it might be possible...the company would need this setup unfront...I can't see any links to one from the website...

    Hope that answers your question

  5. #35
    Join Date
    Jun 2008
    Location
    imjscn
    Beans
    130

    Re: Conky Google Calendar Python Script

    kaivalagi. thanks for look into this.
    No, there are no google puclic calendar represents this link in full because people just take a part that in their interest to their google calendar. But I need it in full.
    Now I understand how this tech works. Maybe I just import this calendar into my google calenda, then, implement your tech to get it in conky.
    Thanks!

  6. #36
    Join Date
    Aug 2007
    Location
    /dev/null
    Beans
    444
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: Conky Google Calendar Python Script

    kaivalagi, thanks a million for this! I had a very clunky script using gcalcli, but this provides for far more elegant output.

    Two things I might suggest:

    1) The ability to not display the time on "All Day" events. I have added this into the code (in the "Formatting Functions" section, and it does the trick for me. Granted, this would filter out any task starting at midnight, but...

    Code:
    starttime = starttime.replace("12:00:00 AM","")
    2) Probably an easy thing to add, but I can't quite figure out where. If there are no tasks, return a string like "No tasks found."

    Otherwise, this is absolutely fantastic!

  7. #37
    Join Date
    Feb 2008
    Location
    52°38'41.6"N/1°19'43.6"E
    Beans
    Hidden!

    Re: Conky Google Calendar Python Script

    Quote Originally Posted by eriqjaffe View Post
    1) The ability to not display the time on "All Day" events. I have added this into the code (in the "Formatting Functions" section, and it does the trick for me. Granted, this would filter out any task starting at midnight, but...

    Code:
    starttime = starttime.replace("12:00:00 AM","")
    For the all day task it should be returning no time field already? When an all day event comes through it has no time aspect, which I make sure doesn't show using getDateFromWhen function. There must be certain circumstances where this is not always the case. I'll add some further checks for range between start and end datetime, when it is a full day I'll make sure no time is shown.

    Can you tell we what the date format comes through as for you? DD/MM/YYYY HH:MM:SS etc? The script is locale based...that might have some effect also?

    Quote Originally Posted by eriqjaffe View Post
    2) Probably an easy thing to add, but I can't quite figure out where. If there are no tasks, return a string like "No tasks found."
    This one should be easy enough, I just need to add a check for the length of the event list that comes back, and if zero print "No tasks found"

    Let me know what the format of the datetime is for you, and I'll then get this sorted over the next couple of days...

    Glad you find the script useful

    Cheers

  8. #38
    Join Date
    Aug 2007
    Location
    /dev/null
    Beans
    444
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: Conky Google Calendar Python Script

    Here's what I get with raw output from the script - all the events in the calendar are "all day" events:

    Code:
    eriq@eriq-ubuntu:~/cgc$ python conkyGoogleCalendar.py --username=*****@gmail.com --password=***** --daysahead=7
    Title: Do checking
    Start Time: Mon 21 Jul 2008 12:00:00 AM 
    End Time: Tue 22 Jul 2008 12:00:00 AM 
    Who: *****@gmail.com
    
    Title: Mail mortgage
    Start Time: Wed 23 Jul 2008 12:00:00 AM 
    End Time: Thu 24 Jul 2008 12:00:00 AM 
    Who: *****@gmail.com
    You mentioned that it's locale based, and that could be the issue, since we're on different sides of the Atlantic.

  9. #39
    Join Date
    Feb 2008
    Location
    52°38'41.6"N/1°19'43.6"E
    Beans
    Hidden!

    Re: Conky Google Calendar Python Script

    Quote Originally Posted by eriqjaffe View Post
    Here's what I get with raw output from the script - all the events in the calendar are "all day" events:

    Code:
    eriq@eriq-ubuntu:~/cgc$ python conkyGoogleCalendar.py --username=*****@gmail.com --password=***** --daysahead=7
    Title: Do checking
    Start Time: Mon 21 Jul 2008 12:00:00 AM 
    End Time: Tue 22 Jul 2008 12:00:00 AM 
    Who: *****@gmail.com
    
    Title: Mail mortgage
    Start Time: Wed 23 Jul 2008 12:00:00 AM 
    End Time: Thu 24 Jul 2008 12:00:00 AM 
    Who: *****@gmail.com
    You mentioned that it's locale based, and that could be the issue, since we're on different sides of the Atlantic.
    This is going to be a tricky one, I've attached an updated script to include "12:00:00 AM" as something to strip out when converting date only data to a string...hopefully that will sort it. For my locales, the system converts a date only datetime type to a string with "00:00:00" on the end instead, which I already catered for.

    I'm assuming that the all day events have been added via google calendar itself and not from a sync for another client such as outlook? If this is the case you might want to check the difference for output between an all day event created directly in Google calendar to this one, it might explain things?

    Could you also run the attached python script called dateformat.py, it will tell us what your locale settings are.

    Even if the main script change fixes the issue I'd like to know what the output is, as it might help me understand other issues around the corner.

    Mine comes out with:
    Code:
    datetimeformat:%a %d %b %Y %T %Z
    dateformat:%d/%m/%y
    From all this we should have a good idea of the problem

    Why couldn't we all just use the same date time formatting! You guys over the Atlantic have to be different

    I've also added a check for any events, if non are found then it just outputs "No Events...".

    When this all checks out I'll update the first post
    Attached Files Attached Files
    Last edited by kaivalagi; July 19th, 2008 at 11:04 AM.

  10. #40
    Join Date
    Aug 2007
    Location
    /dev/null
    Beans
    444
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: Conky Google Calendar Python Script

    The udpated script does the trick (for me, at least) without having to modify anytyhing, thanks!

    All of the events were added directly to the Google Calendar as recurring all-day events via Google's web interface. I haven't tried using other methods (I know events can be added via gcalcli, for example), so I don't know how they will wind up displaying.

    And, sure enough, my date & time formats are different:

    Code:
    datetimeformat:%a %d %b %Y %r %Z
    dateformat:%m/%d/%Y
    Thanks again, hope that information comes in handy.

Page 4 of 47 FirstFirst ... 2345614 ... LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •