Re: [O] Google Tasks Integration

2012-02-03 Thread Eric S Fraga
Simon Thum simon.t...@gmx.de writes:

 On 01/31/2012 08:10 PM, Eric S Fraga wrote:
 Simon Thumsimon.t...@gmx.de  writes:


 On 01/31/2012 02:12 PM, Eric S Fraga wrote:
 I would be very interested in this.  I have links to and from google
 calendar for appointments but could not figure out how to do either
 direction for TODO items.
 You might want to give my script a try:

 https://github.com/simonthum/ical2org

 I'm using it against SoGo but I reckon any iCalendar thing would work,
 which TTBOMK includes google calendar.

 Cheers,

 Simon

 Thanks.  I already have an equivalent (described here a long time ago
 and also on Worg, albeit out of date -- sorry).  The problem is that
 Google doesn't export the TODO list when you ask for an ics file for a
 particular calendar.  At least, I've not figured out how to get the list
 exported.
 I see. Is your script published?

The scripts I use, or slightly older versions, and other bits can be
found on Worg:

http://orgmode.org/worg/org-tutorials/org-google-sync.html

Sorry for delay in getting back to you -- I usually read my emails while
offline!


-- 
: Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.0.92.1
: using Org-mode version 7.8.03 (release_7.8.03.310.g64734)




Re: [O] Google Tasks Integration

2012-02-02 Thread Matthew Jones
Hey guys... I'm the maintainer of MobileOrg for Android.  We've been
implementing a lot of features lately and have a big release coming up this
weekend.

One thing that we've been working on is being able to integrate MobileOrg
with the Calendar on Android devices.  I'm hoping it can make it into the
release this weekend.  If you want to follow the progress we're tracking it
in this branch until we deem it stable enough:

https://github.com/matburt/mobileorg-android/tree/calendar


On Wed, Feb 1, 2012 at 3:35 PM, Simon Thum simon.t...@gmx.de wrote:

 On 01/31/2012 08:10 PM, Eric S Fraga wrote:

 Simon Thumsimon.t...@gmx.de  writes:

  On 01/31/2012 02:12 PM, Eric S Fraga wrote:

 I would be very interested in this.  I have links to and from google
 calendar for appointments but could not figure out how to do either
 direction for TODO items.

 You might want to give my script a try:

 https://github.com/simonthum/**ical2orghttps://github.com/simonthum/ical2org

 I'm using it against SoGo but I reckon any iCalendar thing would work,
 which TTBOMK includes google calendar.

 Cheers,

 Simon


 Thanks.  I already have an equivalent (described here a long time ago
 and also on Worg, albeit out of date -- sorry).  The problem is that
 Google doesn't export the TODO list when you ask for an ics file for a
 particular calendar.  At least, I've not figured out how to get the list
 exported.

 I see. Is your script published?

 I might explore CalDAV a bit more, but from what I saw the spec, which
 limits one collection to one item type, may be the root cause. Although an
 ics can contain multiple collections, I wouldn't wonder seeing one file per
 item type setups.

 But that's just a wild guess.

 Cheers,

 Simon




Re: [O] Google Tasks Integration

2012-02-01 Thread Simon Thum

On 01/31/2012 08:10 PM, Eric S Fraga wrote:

Simon Thumsimon.t...@gmx.de  writes:


On 01/31/2012 02:12 PM, Eric S Fraga wrote:

I would be very interested in this.  I have links to and from google
calendar for appointments but could not figure out how to do either
direction for TODO items.

You might want to give my script a try:

https://github.com/simonthum/ical2org

I'm using it against SoGo but I reckon any iCalendar thing would work,
which TTBOMK includes google calendar.

Cheers,

Simon


Thanks.  I already have an equivalent (described here a long time ago
and also on Worg, albeit out of date -- sorry).  The problem is that
Google doesn't export the TODO list when you ask for an ics file for a
particular calendar.  At least, I've not figured out how to get the list
exported.

I see. Is your script published?

I might explore CalDAV a bit more, but from what I saw the spec, which 
limits one collection to one item type, may be the root cause. Although 
an ics can contain multiple collections, I wouldn't wonder seeing one 
file per item type setups.


But that's just a wild guess.

Cheers,

Simon



Re: [O] Google Tasks Integration

2012-01-31 Thread Eric S Fraga
Patrick Brennan pbren...@gmail.com writes:

 This weekend, while trying to avoid doing any real work, I started noodling
 around with the Google Tasks API and I got a respectable distance toward a
 script which will read your Google Tasks and export them to Org-mode.
 Currently it will capture the task title, the notes, the todo status (TODO
 or DONE) and the hierarchy, i.e. child tasks will be correctly placed under
 their parents. There's still a lot of polish to apply, and of course, there
 is no bidirectional capability as yet. Still, I wanted to send out this
 notice in case anyone wanted to compare notes or thought it might be an
 interesting application to share. The mobile apps for Google Tasks are
 quite good, and if I can get a really good export going, I think this will
 actually provide a plausible alternative workflow to the existing MobileOrg
 flow.

 Patrick

I would be very interested in this.  I have links to and from google
calendar for appointments but could not figure out how to do either
direction for TODO items.

Thanks,
eric

-- 
: Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.0.92.1
: using Org-mode version 7.8.03 (release_7.8.03.283.g171ea)




Re: [O] Google Tasks Integration

2012-01-31 Thread Mehul Sanghvi
On Mon, Jan 30, 2012 at 23:33, Patrick Brennan pbren...@gmail.com wrote:
 This weekend, while trying to avoid doing any real work, I started noodling
 around with the Google Tasks API and I got a respectable distance toward a
 script which will read your Google Tasks and export them to Org-mode.
 Currently it will capture the task title, the notes, the todo status (TODO
 or DONE) and the hierarchy, i.e. child tasks will be correctly placed under
 their parents. There's still a lot of polish to apply, and of course, there
 is no bidirectional capability as yet. Still, I wanted to send out this
 notice in case anyone wanted to compare notes or thought it might be an
 interesting application to share. The mobile apps for Google Tasks are quite
 good, and if I can get a really good export going, I think this will
 actually provide a plausible alternative workflow to the existing MobileOrg
 flow.

 Patrick


This is good.  Let me know if I can help with testing or such things.  Since
I've got an Android phone and starting a new job next week, I've been trying
to get organized, using my phone as the center of it.  Was trying to use
MobileOrg but the workflow doesn't work well for me.  Maybe I'm
using it properly.  Either way, this is a nice option to have.


cheers,

   mehul


-- 
Mehul N. Sanghvi
email: mehul.sang...@gmail.com



Re: [O] Google Tasks Integration

2012-01-31 Thread Simon Thum

On 01/31/2012 02:12 PM, Eric S Fraga wrote:

I would be very interested in this.  I have links to and from google
calendar for appointments but could not figure out how to do either
direction for TODO items.

You might want to give my script a try:

https://github.com/simonthum/ical2org

I'm using it against SoGo but I reckon any iCalendar thing would work, 
which TTBOMK includes google calendar.


Cheers,

Simon



Re: [O] Google Tasks Integration

2012-01-31 Thread Simon Thum

On 01/30/2012 08:33 PM, Patrick Brennan wrote:

This weekend, while trying to avoid doing any real work, I started noodling
around with the Google Tasks API and I got a respectable distance toward a
script which will read your Google Tasks and export them to Org-mode.
Currently it will capture the task title, the notes, the todo status (TODO
or DONE) and the hierarchy, i.e. child tasks will be correctly placed under
their parents. There's still a lot of polish to apply, and of course, there
is no bidirectional capability as yet. Still, I wanted to send out this
notice in case anyone wanted to compare notes or thought it might be an
interesting application to share. The mobile apps for Google Tasks are
quite good, and if I can get a really good export going, I think this will
actually provide a plausible alternative workflow to the existing MobileOrg
flow.

Patrick



I'm interested. I've written a CalDAV importer (and recently published 
part of it) and I'm interested in finding ways to get at least some 
amount of bi-directionality, for example, avoiding to re-import org 
entries (I can do that but it will work only for me then). Perhaps we 
can find some guidelines for sync.


Cheers,

Simon



Re: [O] Google Tasks Integration

2012-01-31 Thread Patrick Brennan
Hi Eric,

Here is the script. It's pretty simple. There is no facility for
synchronizing an org-mode file as yet. I think the best way to do the sync
would be to do it when pushing an org-mode file to Google Tasks.

Tell me how you like this and if it works well for you.

Patrick

PS:

** Requirements:
  - Python 2.6. This is the version I am using, and I am not sure if an
earlier
version will work.
  - setuptools. This is necessary in order to install the Google API for
Python.
Get setuptools from here:
http://pypi.python.org/pypi/setuptools#downloads
I downloaded the egg package
(
http://pypi.python.org/packages/2.6/s/setuptools/setuptools-0.6c11-py2.6.egg#md5=bfa92100bd772d5a213eedd356d64086
),
set it to +x and run it
sudo ./setuptools-0.6c11-py2.6.egg
  - Google Tasks API for Python.
Use easy_install per this page:
http://code.google.com/p/google-api-python-client/wiki/Installation
sudo easy_install --upgrade google-api-python-client

Thanks,
Patrick

On Tue, Jan 31, 2012 at 5:12 AM, Eric S Fraga e.fr...@ucl.ac.uk wrote:

 Patrick Brennan pbren...@gmail.com writes:

  This weekend, while trying to avoid doing any real work, I started
 noodling
  around with the Google Tasks API and I got a respectable distance toward
 a
  script which will read your Google Tasks and export them to Org-mode.
  Currently it will capture the task title, the notes, the todo status
 (TODO
  or DONE) and the hierarchy, i.e. child tasks will be correctly placed
 under
  their parents. There's still a lot of polish to apply, and of course,
 there
  is no bidirectional capability as yet. Still, I wanted to send out this
  notice in case anyone wanted to compare notes or thought it might be an
  interesting application to share. The mobile apps for Google Tasks are
  quite good, and if I can get a really good export going, I think this
 will
  actually provide a plausible alternative workflow to the existing
 MobileOrg
  flow.
 
  Patrick

 I would be very interested in this.  I have links to and from google
 calendar for appointments but could not figure out how to do either
 direction for TODO items.

 Thanks,
 eric

 --
 : Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.0.92.1
 : using Org-mode version 7.8.03 (release_7.8.03.283.g171ea)


#! /usr/bin/python
import gflags
import httplib2
import math
import re

from apiclient.discovery import build
from oauth2client.file import Storage
from oauth2client.client import OAuth2WebServerFlow
from oauth2client.tools import run


# Algorithm from pg 7 of Peter Duffet-Smith, 
# Practical Astronomy With Your Calculator, 3d ed.
# Check against http://www.onlineconversion.com/julian_date.htm
# and Orbiter distribution/Utils/Date.exe
# This version does not check for Gregorian calendar or BC!!!
# This version does not handle fractional days!!!
def JulianDate (Year,Month,Day,modified=False):
if (Month == 1)or(Month == 2):
Yprime = Year - 1
Mprime = Month + 12
else:
Yprime = Year
Mprime = Month

A = math.floor(Yprime / 100.0)
B = 2.0 - A + math.floor(A / 4.0)

C = math.floor(365.25 * Yprime)

D = math.floor(30.6001 * (Mprime + 1.0))

# Julian Day
JD = B + C + D + Day + 1720994.5

# Modified Julian Day
MJD = B + C + D + Day - 679006.0

if modified:
return MJD
else:
return JD


# Given a year, month, and day, compute the day of the week
def DayOfWeek(Year,Month,Day):
dayNames = [ 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat' ]
mjd = JulianDate(Year,Month,Day,True)
diff = mjd - 15019.0
# dayIndex = math.floor(diff) % 7
dayIndex = int(diff) % 7
return dayNames[dayIndex]


# Given a string which represents a date and time, e.g.
# '2012-01-30T23:59:00Z' RFC 3339 timestamp
# Format it into a Org-Mode date.
def formatDateTimeStringToOrgMode(DateTimeString,angleBrackets=True):
prog = re.compile('([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})(.{1})')
match = prog.match(DateTimeString)

Year = int(match.group(1))
Month = int(match.group(2))
Day = int(match.group(3))
ShortDayName = DayOfWeek(Year,Month,Day)
Hour = int(match.group(4))
Minute = int(match.group(5))
Second = int(match.group(6))
TimeZone = match.group(7) # TODO: Use the timezone somehow

if angleBrackets:
openBracket = ''
closeBracket = ''
else:
openBracket = '['
closeBracket = ']'

retString = '%s%04d-%02d-%02d %s %02d:%02d:%02d%s' % \
(openBracket, \
 Year, Month, Day, ShortDayName, Hour, Minute, Second, \
 closeBracket)

return retString


# A 

Re: [O] Google Tasks Integration

2012-01-31 Thread Eric S Fraga
Simon Thum simon.t...@gmx.de writes:

 On 01/31/2012 02:12 PM, Eric S Fraga wrote:
 I would be very interested in this.  I have links to and from google
 calendar for appointments but could not figure out how to do either
 direction for TODO items.
 You might want to give my script a try:

 https://github.com/simonthum/ical2org

 I'm using it against SoGo but I reckon any iCalendar thing would work,
 which TTBOMK includes google calendar.

 Cheers,

 Simon

Thanks.  I already have an equivalent (described here a long time ago
and also on Worg, albeit out of date -- sorry).  The problem is that
Google doesn't export the TODO list when you ask for an ics file for a
particular calendar.  At least, I've not figured out how to get the list
exported.


-- 
: Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.0.92.1
: using Org-mode version 7.8.03 (release_7.8.03.283.g171ea)




[O] Google Tasks Integration

2012-01-30 Thread Patrick Brennan
This weekend, while trying to avoid doing any real work, I started noodling
around with the Google Tasks API and I got a respectable distance toward a
script which will read your Google Tasks and export them to Org-mode.
Currently it will capture the task title, the notes, the todo status (TODO
or DONE) and the hierarchy, i.e. child tasks will be correctly placed under
their parents. There's still a lot of polish to apply, and of course, there
is no bidirectional capability as yet. Still, I wanted to send out this
notice in case anyone wanted to compare notes or thought it might be an
interesting application to share. The mobile apps for Google Tasks are
quite good, and if I can get a really good export going, I think this will
actually provide a plausible alternative workflow to the existing MobileOrg
flow.

Patrick


Re: [O] Google Tasks Integration

2012-01-30 Thread Philipp Haselwarter
On Mon, Jan 30 2012 20:33 (@1327951983), Patrick Brennan wrote:

 This weekend, while trying to avoid doing any real work, I started noodling
 around with the Google Tasks API and I got a respectable distance toward a
 script which will read your Google Tasks and export them to Org-mode.
 Currently it will capture the task title, the notes, the todo status (TODO
 or DONE) and the hierarchy, i.e. child tasks will be correctly placed under
 their parents. There's still a lot of polish to apply, and of course, there
 is no bidirectional capability as yet. Still, I wanted to send out this
 notice in case anyone wanted to compare notes or thought it might be an
 interesting application to share. The mobile apps for Google Tasks are
 quite good, and if I can get a really good export going, I think this will
 actually provide a plausible alternative workflow to the existing MobileOrg
 flow.

 Patrick
#secure method=pgpmime mode=sign

Sounds awesome; one thought: Make it CalDAV instead of Google only.
Google supports CalDAV from what I understand, and using a standard
protocol will make your work useful for a much wider public!

-- 
Philipp Haselwarter




Re: [O] Google Tasks integration

2011-10-22 Thread Bastien
Hi Brad,

Brad Collette shopinthewo...@gmail.com writes:

 Is there any work going on to be able to take advantage of this API
 from org-mode?

Not to my knowledge, but interactions with various API is definitely 
something we want.

-- 
 Bastien



Re: [O] Google Tasks integration

2011-09-06 Thread Robert Goldman
On 9/3/11 Sep 3 -12:44 PM, Sven Bretfeld wrote:
 Hi Brad
 
 I don't know anything about your question proper, but ...
 
 Brad Collette shopinthewo...@gmail.com writes:
 
 I've also been using mobileorg to get my stuff on my iphone.  However, I'm 
 less
 satisfied with that.  Having to both push and pull from both ends to keep 
 things
 in sync is a pain and I often forget.
 
 This is absolutely automatized on my system. I don't have to do anything
 except keep the computer running. As an Android user I don't know if
 MobileOrg on iPhone can sync automatically, the Android app can. I have
 configured it to sync every 30 min. on my phone and pad. My computer
 runs a cronjob every 20 minutes that pulls and pushes. Here is the
 script that does the job:
 
 #!/bin/bash
 
 emacs --batch --load ~/.emacs --eval (gtd) --eval (org-mobile-pull) 
 --eval (org-save-all-org-buffers) --eval (org-mobile-push)
 
 If you are on Linux or Mac the script should work as a cronjob. I don't
 know about Windows. 
 

Could you amplify a little on how this works?  I believe that
org-mobile-push is a side-effecting operation (among other things it
adds ID properties).  So how can you run this cron job all the time?
Doesn't it interact badly with running your own interactive emacs job?

thanks,
r




Re: [O] Google Tasks integration

2011-09-03 Thread Sven Bretfeld
Hi Brad

I don't know anything about your question proper, but ...

Brad Collette shopinthewo...@gmail.com writes:

 I've also been using mobileorg to get my stuff on my iphone.  However, I'm 
 less
 satisfied with that.  Having to both push and pull from both ends to keep 
 things
 in sync is a pain and I often forget.

This is absolutely automatized on my system. I don't have to do anything
except keep the computer running. As an Android user I don't know if
MobileOrg on iPhone can sync automatically, the Android app can. I have
configured it to sync every 30 min. on my phone and pad. My computer
runs a cronjob every 20 minutes that pulls and pushes. Here is the
script that does the job:

#!/bin/bash

emacs --batch --load ~/.emacs --eval (gtd) --eval (org-mobile-pull) --eval 
(org-save-all-org-buffers) --eval (org-mobile-push)

If you are on Linux or Mac the script should work as a cronjob. I don't
know about Windows. 

Greetings,

Sven



[O] Google Tasks integration

2011-09-01 Thread Brad Collette
I've been using org-mode for a year or so and I really like it.

I've also been using mobileorg to get my stuff on my iphone.  However, I'm
less satisfied with that.  Having to both push and pull from both ends to
keep things in sync is a pain and I often forget.

I saw that Google released an API for tasks back in May.
http://googlesystem.blogspot.com/2011/05/google-tasks-api.html

I'd love to be able to just push/pull from the desktop and then access my
tasks through one of the many task apps available on the phone or from
machines that don't have org-mode or access to my org files.

Is there any work going on to be able to take advantage of this API from
org-mode?