emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Ian Barton <lists@manor-farm.org>
To: emacs-orgmode@gnu.org
Subject: Re: iPhone ----> org-mode
Date: Mon, 23 Mar 2009 13:47:21 +0000	[thread overview]
Message-ID: <49C792E9.4030602@manor-farm.org> (raw)
In-Reply-To: <f47cd1b50903230132o6fc904crcbeb5cb77cae2551@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1025 bytes --]

> 
> 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.

[-- Attachment #2: requall.py --]
[-- Type: text/x-python, Size: 1082 bytes --]

#!/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

[-- Attachment #3: Type: text/plain, Size: 204 bytes --]

_______________________________________________
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

  reply	other threads:[~2009-03-23 14:03 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-22 10:38 iPhone ----> org-mode Brad Bozarth
2009-03-22 13:52 ` Carsten Dominik
2009-03-23  8:32   ` Brad Bozarth
2009-03-23 13:47     ` Ian Barton [this message]
2009-03-24  0:43       ` Brad Bozarth
2009-03-24  7:37         ` Carsten Dominik
2009-03-24  8:30           ` Ian Barton
2009-03-24  8:38             ` Carsten Dominik
2009-03-24 10:20               ` Ian Barton
2009-03-24  7:03       ` Rob Weir
2009-03-25  5:56     ` Brad Bozarth
2009-03-25  8:00       ` Brad Bozarth
2009-03-22 21:23 ` John Rakestraw
2009-03-24 11:32 ` Carsten Dominik
2009-03-24 18:21   ` Brad Bozarth
2009-03-25  8:28     ` Carsten Dominik
2009-03-25  8:36 ` Carsten Dominik
2009-03-25  8:50   ` Brad Bozarth
2009-03-25 19:52     ` Carsten Dominik
2009-03-25 20:39       ` John Rakestraw
2009-03-25 20:40         ` Carsten Dominik
2009-03-25  9:06   ` Brad Bozarth
2009-03-25  9:09     ` Carsten Dominik
2009-03-25  9:25       ` Carsten Dominik
2009-03-25  9:35   ` Ian Barton
2009-03-25 10:57     ` William Henney
2009-03-26 15:39       ` Carsten Dominik
2009-03-26 17:07         ` William Henney
2009-03-26 18:20           ` Richard Riley
     [not found]         ` <71454fac0903261121u79e85c3bq2538a294701e4c78@mail.gmail.com>
2009-03-27  9:15           ` Carsten Dominik
2009-03-27 15:45             ` Sven Bretfeld
2009-03-27 17:29               ` Carsten Dominik
2009-03-27 18:07                 ` David Bremner
2009-03-25 14:29     ` Bernt Hansen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=49C792E9.4030602@manor-farm.org \
    --to=lists@manor-farm.org \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).