From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Barton Subject: Re: iPhone ----> org-mode Date: Mon, 23 Mar 2009 13:47:21 +0000 Message-ID: <49C792E9.4030602@manor-farm.org> References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------010705070504070408070807" Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Llkkk-0004sF-Eb for emacs-orgmode@gnu.org; Mon, 23 Mar 2009 10:03:46 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Llkkf-0004r6-Qs for emacs-orgmode@gnu.org; Mon, 23 Mar 2009 10:03:46 -0400 Received: from [199.232.76.173] (port=60614 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Llkkf-0004r1-Jv for emacs-orgmode@gnu.org; Mon, 23 Mar 2009 10:03:41 -0400 Received: from a2s22.a2hosting.com ([69.39.86.130]:59582) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Llkke-0000TA-W6 for emacs-orgmode@gnu.org; Mon, 23 Mar 2009 10:03:41 -0400 Received: from [217.146.125.41] (helo=firewall.banter.local) by a2s22.a2hosting.com with esmtp (Exim 4.69) (envelope-from ) id 1Llkkb-0005At-VK for emacs-orgmode@gnu.org; Mon, 23 Mar 2009 10:03:38 -0400 Received: from localhost (localhost [127.0.0.1]) by firewall.banter.local (Postfix) with ESMTP id 097F0DF2F for ; Mon, 23 Mar 2009 13:47:34 +0000 (GMT) Received: from firewall.banter.local ([127.0.0.1]) by localhost (firewall.banter.local [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id kByOeqOGyEJ7 for ; Mon, 23 Mar 2009 13:47:22 +0000 (GMT) Received: from [192.168.0.60] (scamper.banter.local [192.168.0.60]) by firewall.banter.local (Postfix) with ESMTP id 10AF4DF2E for ; Mon, 23 Mar 2009 13:47:22 +0000 (GMT) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org This is a multi-part message in MIME format. --------------010705070504070408070807 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit > > Pretty simple - it could be cleaner, and filenames and such are > hardcoded, but it should be easy for anyone to fix it up or simply > replace the filenames and formatting to their liking. It's simple ... > but still feels like magic when I press one button on my iPhone in the > car, and what I spoke is sitting in my gtd.org when I get to the > office :) ... tarball of hack attached. Note that my awk is from OS X, > should work on linux as well though (I first got it running on linux, > but had to escape some / characters in a pattern match to get > reqallxml.awk to work on my mac and haven't tested it again on linux). Appended is a quick hack in Python that appends items from the rss feed to an org file. Tasks are give the guid property, which is used to identify which tasks have already been imported. Requires Mark Pilgrim's feed parser (think this is already part of Python) and Charles Cave's orgnode.py. Note orgnode.py seems to have a bug, where it requires at least one entry in the file. Ian. --------------010705070504070408070807 Content-Type: text/x-python; name="requall.py" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="requall.py" #!/usr/bin/python import feedparser # Note the current version of orgnode.py # requires a file with at least one entry. import orgnode REQUALL_URL = 'Requall RSS feed url' ORG_FILE = 'todo.org' def write_task(task): logfile = open(ORG_FILE, 'a') str = "* TODO %s\n:PROPERTIES:\n:guid: %s\n:END:\n%s\n" % (task.title, task.guid, task.description) logfile.write(str) logfile.close() def load_org_file(): """ Create a list of org objects. """ nodelist = orgnode.makelist(ORG_FILE) return nodelist # Open and parse the rss feed. d = feedparser.parse(REQUALL_URL) print d.feed.title for entry in d['entries']: nodelist = load_org_file() guids = [] # build a list of all the guids in the org file. for node in nodelist: guids.append(node.Property('guid')) # Only add entries for guids that are not already in the file. if entry.guid in guids: print "Entry skipped." else: write_task(entry) print entry.title print entry.category print entry.description --------------010705070504070408070807 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode --------------010705070504070408070807--