From mboxrd@z Thu Jan 1 00:00:00 1970 From: Patrick Brennan Subject: Re: Google Tasks Integration Date: Tue, 31 Jan 2012 10:31:03 -0800 Message-ID: References: <8762fs9fsk.fsf@pinto.chemeng.ucl.ac.uk> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary=f46d0442829c8deeb604b7d72bab Return-path: Received: from eggs.gnu.org ([140.186.70.92]:52473) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RsIUM-0007jh-Bm for emacs-orgmode@gnu.org; Tue, 31 Jan 2012 13:31:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RsIUG-0008V5-N6 for emacs-orgmode@gnu.org; Tue, 31 Jan 2012 13:31:30 -0500 Received: from mail-wi0-f169.google.com ([209.85.212.169]:61984) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RsIUG-0008Uv-5p for emacs-orgmode@gnu.org; Tue, 31 Jan 2012 13:31:24 -0500 Received: by wibhj13 with SMTP id hj13so332634wib.0 for ; Tue, 31 Jan 2012 10:31:23 -0800 (PST) In-Reply-To: <8762fs9fsk.fsf@pinto.chemeng.ucl.ac.uk> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Patrick Brennan , emacs-orgmode@gnu.org --f46d0442829c8deeb604b7d72bab Content-Type: multipart/alternative; boundary=f46d0442829c8deeb404b7d72ba9 --f46d0442829c8deeb404b7d72ba9 Content-Type: text/plain; charset=ISO-8859-1 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 wrote: > Patrick Brennan 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) > > --f46d0442829c8deeb404b7d72ba9 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi Eric,=A0

Here is the script. It's pret= ty 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-m= ode file to Google Tasks.

Tell me how you like this and if it works w= ell for you.

Patrick
<= br>
PS:

** Requir= ements:
=A0 - Python 2.6. This is the version I am using, and I am not sure if= an earlier
=A0 =A0 version will work.
=A0 - setuptools= . This is necessary in order to install the Google API for Python.
=A0 =A0 Get setuptools from here:=A0
=A0 =A0 I downloaded the egg package= =A0
=A0 =A0 set it to +x and run it
=A0 =A0 sudo ./setuptools-0.= 6c11-py2.6.egg
=A0 - Google Tasks API for Python.
=A0 = =A0 Use easy_install per this page:=A0
=A0 =A0 sudo easy_install --upgrade google-api-python-client

Thanks,
Patrick


--f46d0442829c8deeb404b7d72ba9-- --f46d0442829c8deeb604b7d72bab Content-Type: text/x-python; charset=US-ASCII; name="TasksToOrgMode.py" Content-Disposition: attachment; filename="TasksToOrgMode.py" Content-Transfer-Encoding: base64 X-Attachment-Id: f_gy39jho20 IyEgL3Vzci9iaW4vcHl0aG9uCmltcG9ydCBnZmxhZ3MKaW1wb3J0IGh0dHBsaWIyCmltcG9ydCBt YXRoCmltcG9ydCByZQoKZnJvbSBhcGljbGllbnQuZGlzY292ZXJ5IGltcG9ydCBidWlsZApmcm9t IG9hdXRoMmNsaWVudC5maWxlIGltcG9ydCBTdG9yYWdlCmZyb20gb2F1dGgyY2xpZW50LmNsaWVu dCBpbXBvcnQgT0F1dGgyV2ViU2VydmVyRmxvdwpmcm9tIG9hdXRoMmNsaWVudC50b29scyBpbXBv cnQgcnVuCgojIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMj IyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMKIyBBbGdvcml0aG0gZnJvbSBwZyA3IG9mIFBldGVyIER1 ZmZldC1TbWl0aCwgCiMgUHJhY3RpY2FsIEFzdHJvbm9teSBXaXRoIFlvdXIgQ2FsY3VsYXRvciwg M2QgZWQuCiMgQ2hlY2sgYWdhaW5zdCBodHRwOi8vd3d3Lm9ubGluZWNvbnZlcnNpb24uY29tL2p1 bGlhbl9kYXRlLmh0bQojIGFuZCA8T3JiaXRlciBkaXN0cmlidXRpb24+L1V0aWxzL0RhdGUuZXhl CiMgVGhpcyB2ZXJzaW9uIGRvZXMgbm90IGNoZWNrIGZvciBHcmVnb3JpYW4gY2FsZW5kYXIgb3Ig QkMhISEKIyBUaGlzIHZlcnNpb24gZG9lcyBub3QgaGFuZGxlIGZyYWN0aW9uYWwgZGF5cyEhIQpk ZWYgSnVsaWFuRGF0ZSAoWWVhcixNb250aCxEYXksbW9kaWZpZWQ9RmFsc2UpOgogICAgaWYgKE1v bnRoID09IDEpb3IoTW9udGggPT0gMik6CiAgICAgICAgWXByaW1lID0gWWVhciAtIDEKICAgICAg ICBNcHJpbWUgPSBNb250aCArIDEyCiAgICBlbHNlOgogICAgICAgIFlwcmltZSA9IFllYXIKICAg ICAgICBNcHJpbWUgPSBNb250aAoKICAgIEEgPSBtYXRoLmZsb29yKFlwcmltZSAvIDEwMC4wKQog ICAgQiA9IDIuMCAtIEEgKyBtYXRoLmZsb29yKEEgLyA0LjApCgogICAgQyA9IG1hdGguZmxvb3Io MzY1LjI1ICogWXByaW1lKQoKICAgIEQgPSBtYXRoLmZsb29yKDMwLjYwMDEgKiAoTXByaW1lICsg MS4wKSkKCiAgICAjIEp1bGlhbiBEYXkKICAgIEpEID0gQiArIEMgKyBEICsgRGF5ICsgMTcyMDk5 NC41CiAgICAKICAgICMgTW9kaWZpZWQgSnVsaWFuIERheQogICAgTUpEID0gQiArIEMgKyBEICsg RGF5IC0gNjc5MDA2LjAKICAgIAogICAgaWYgbW9kaWZpZWQ6CiAgICAgICAgcmV0dXJuIE1KRAog ICAgZWxzZToKICAgICAgICByZXR1cm4gSkQKCiMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMj IyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIwojIEdpdmVuIGEgeWVh ciwgbW9udGgsIGFuZCBkYXksIGNvbXB1dGUgdGhlIGRheSBvZiB0aGUgd2VlawpkZWYgRGF5T2ZX ZWVrKFllYXIsTW9udGgsRGF5KToKICAgIGRheU5hbWVzID0gWyAnU3VuJywgJ01vbicsICdUdWUn LCAnV2VkJywgJ1RodScsICdGcmknLCAnU2F0JyBdCiAgICBtamQgPSBKdWxpYW5EYXRlKFllYXIs TW9udGgs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XRs ZScpCiAgICBwcmludERpY3RBdHRyaWJ1dGVJZkV4aXN0cyh0YXNrLCIgICAgS2luZCAgICAgOiAi LCAna2luZCcpCiAgICBwcmludERpY3RBdHRyaWJ1dGVJZkV4aXN0cyh0YXNrLCIgICAgaWQgICAg ICAgOiAiLCAnaWQnKQogICAgcHJpbnREaWN0QXR0cmlidXRlSWZFeGlzdHModGFzaywiICAgIGV0 YWcgICAgIDogIiwgJ2V0YWcnKQogICAgcHJpbnREaWN0QXR0cmlidXRlSWZFeGlzdHModGFzaywi ICAgIHVwZGF0ZWQgIDogIiwgJ3VwZGF0ZWQnKQogICAgcHJpbnREaWN0QXR0cmlidXRlSWZFeGlz dHModGFzaywiICAgIHNlbGZMaW5rIDogIiwgJ3NlbGZMaW5rJykKICAgIHByaW50RGljdEF0dHJp YnV0ZUlmRXhpc3RzKHRhc2ssIiAgICBwb3NpdGlvbiA6ICIsICdwb3NpdGlvbicpCiAgICBwcmlu dERpY3RBdHRyaWJ1dGVJZkV4aXN0cyh0YXNrLCIgICAgcGFyZW50ICAgOiAiLCAncGFyZW50JykK ICAgIAogICAgcHJpbnREaWN0QXR0cmlidXRlSWZFeGlzdHModGFzaywiICAgIG5vdGVzICAgIDog IiwgJ25vdGVzJykKICAgIHByaW50RGljdEF0dHJpYnV0ZUlmRXhpc3RzKHRhc2ssIiAgICBzdGF0 dXMgICA6ICIsICdzdGF0dXMnKQogICAgcHJpbnREaWN0QXR0cmlidXRlSWZFeGlzdHModGFzaywi ICAgIGR1ZSAgICAgIDogIiwgJ2R1ZScpCiAgICBwcmludERpY3RBdHRyaWJ1dGVJZkV4aXN0cyh0 YXNrLCIgICAgY29tcGxldGVkOiAiLCAnY29tcGxldGVkJykKICAgIHByaW50RGljdEF0dHJpYnV0 ZUlmRXhpc3RzKHRhc2ssIiAgICBkZWxldGVkICA6ICIsICdkZWxldGVkJykKICAgIHByaW50RGlj dEF0dHJpYnV0ZUlmRXhpc3RzKHRhc2ssIiAgICBoaWRkZW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dlKGRlcHRoKToKICAg ICAgICBzdGFycyA9IHN0YXJzICsgJyonCiAgICAKICAgIHNwYWNlcyA9ICcgICcKICAgIGZvciBp IGluIHJhbmdlKGRlcHRoKToKICAgICAgICBzcGFjZXMgPSBzcGFjZXMgKyAnICcKCiAgICBmb3Ig aSBpbiByYW5nZShsZW4obm9kZUxpc3QpKToKICAgICAgICBub2RlID0gbm9kZUxpc3RbaV0KCiAg ICAgICAgaWYgKG5vZGVbJ3N0YXR1cyddID09ICduZWVkc0FjdGlvbicpOgogICAgICAgICAgICBz dGF0dXMgPSAnIFRPRE8gJwogICAgICAgIGVsaWYgKG5vZGVbJ3N0YXR1cyddID09ICdjb21wbGV0 ZWQnKToKICAgICAgICAgICAgc3RhdHVzID0gJyBET05FICcKICAgICAgICBlbHNlOgogICAgICAg ICAgICBzdGF0dXMgPSAnICcKCiAgICAgICAgdHJ5OgogICAgICAgICAgICBkZWFkbGluZSA9IG5v ZGVbJ2R1ZSddCiAgICAgICAgZXhjZXB0IEtleUVycm9yOgogICAgICAgICAgICBkZWFkbGluZSA9 IEZhbHNlCgogICAgICAgIHRyeToKICAgICAgICAgICAgbm90ZXMgPSBub2RlWydub3RlcyddCiAg ICAgICAgZXhjZXB0IEtleUVycm9yOgogICAgICAgICAgICBub3RlcyA9IEZhbHNlCgogICAgICAg ICMgVE9ETzogQWRkIGNvbXBsZXRlZCBkYXRlCiAgICAgICAgdHJ5OgogICAgICAgICAgICBjb21w bGV0ZWQgPSBub2RlWydjb21wbGV0ZWQnXQogICAgICAgIGV4Y2VwdCBLZXlFcnJvcjoKICAgICAg ICAgICAgY29tcGxldGVkID0gRmFsc2UKCiAgICAgICAgIyBGb3IgcmVjb3JkaW5nIHdoZW4gdGhl IGl0ZW0gd2FzIGNsb3NlZCwgb3IgdGhlIGRlYWRsaW5lCiAgICAgICAgZGF0ZXNfbGluZSA9ICcn CgogICAgICAgIHByaW50IHN0YXJzICsgc3RhdHVzICsgbm9kZVsndGl0bGUnXQoKICAgICAgICBp ZiAoZGVhZGxpbmUgb3IgY29tcGxldGVkKToKICAgICAgICAgICAgZGF0ZXNfbGluZSA9IGRhdGVz X2xpbmUgKyBzcGFjZXMKICAgICAgICBpZiAoY29tcGxldGVkKToKICAgICAgICAgICAgZGF0ZXNf bGluZSA9IGRhdGVzX2xpbmUgKyBcCiAgICAgICAgICAgICAgICAnQ0xPU0VEOiAnICsgZm9ybWF0 RGF0ZVRpbWVTdHJpbmdUb09yZ01vZGUoY29tcGxldGVkLEZhbHNlKQogICAgICAgIGlmIChjb21w bGV0ZWQgYW5kIGRlYWRsaW5lKToKICAgICAgICAgICAgZGF0ZXNfbGluZSA9IGRhdGVzX2xpbmUg KyAnICcKICAgICAgICBpZiAoZGVhZGxpbmUpOgogICAgICAgICAgICBkYXRlc19saW5lID0gZGF0 ZXNfbGluZSArICdERUFETElORTogJyArIFwKICAgICAgICAgICAgICAgIGZvcm1hdERhdGVUaW1l U3RyaW5nVG9PcmdNb2RlKGRlYWRsaW5lKQogICAgICAgIGlmIChkYXRlc19saW5lICE9ICcnKToK ICAgICAgICAgICAgcHJpbnQgZGF0ZXNfbGluZQoKICAgICAgICAjIFByb3BlcnRpZXMuIFRPRE86 IEFueSBvdGhlcnM/CiAgICAgICAgcHJpbnQgc3BhY2VzICsgJzpQUk9QRVJUSUVTOicKICAgICAg ICBwcmludCBzcGFjZXMgKyAnOklEOicgKyAnICAgICAgICcgKyBub2RlWydpZCddCiAgICAgICAg cHJpbnQgc3BhY2VzICsgJzpVUERBVEVEOicgKyAnICAnICsgbm9kZVsndXBkYXRlZCddCiAgICAg ICAgcHJpbnQgc3BhY2VzICsgJzpFTkQ6JwogICAgICAgICAgICAKICAgICAgICBpZiAobm90ZXMp OgogICAgICAgICAgICBub3Rlc2xpbmVzID0gbm90ZXMuc3BsaXQoJ1xuJykKICAgICAgICAgICAg Zm9yIGxpbmUgaW4gbm90ZXNsaW5lczoKICAgICAgICAgICAgICAgIHByaW50IHNwYWNlcyArIGxp b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RvIHRoZWlyIGNvcnJlY3QgcGFyZW50cwogICAgaSA9IDAK ICAgIHdoaWxlIChpPGxlbihvcmdUYXNrTGlzdFsnY2hpbGRyZW4nXSkpOgogICAgICAgIHRyeToK ICAgICAgICAgICAgcGFyZW50SWQgPSBvcmdUYXNrTGlzdFsnY2hpbGRyZW4nXVtpXVsncGFyZW50 J10gICAgICAgICAgICAKICAgICAgICBleGNlcHQgS2V5RXJyb3I6CiAgICAgICAgICAgICMgbm8g cGFyZW50CiAgICAgICAgICAgIHBhcmVudElkID0gJycKICAgICAgICAgICAgaSA9IGkgKyAxCiAg ICAgICAgaWYgKHBhcmVudElkICE9ICcnKToKICAgICAgICAgICAgcGFyZW50Tm9kZSA9IGZpbmRO b2RlKG9yZ1Rhc2tMaXN0WydjaGlsZHJlbiddLCBwYXJlbnRJZCkKICAgICAgICAgICAgaWYgKHBh cmVudE5vZGUpOgogICAgICAgICAgICAgICAgcGFyZW50Tm9kZVsnY2hpbGRyZW4nXS5hcHBlbmQo b3JnVGFza0xpc3RbJ2NoaWxkcmVuJ10ucG9wKGkpKQoKICAgIHByaW50IG9yZ1Rhc2tMaXN0Wyd0 aXRsZSddCiAgICBwcmludAogICAgcHJpbnROb2RlTGlzdChvcmdUYXNrTGlzdFsnY2hpbGRyZW4n XSkKCgo= --f46d0442829c8deeb604b7d72bab--