dannyman.toldme.com


Python, Technical

HOWTO: Parse Recent Twiki Edits in Python

To make up for my snarkiness in my last post . . . it is an easy matter of fetching the WebRss node from Twiki and running it through the Universal Feed Parser:

# Twiki RSS Feed
twiki_rss_url='http://localhost/twiki/bin/view/Main/WebRss'

import feedparser
import time
import calendar

# http://www.feedparser.org/
d = feedparser.parse(twiki_rss_url)

for e in d['entries']:
    # e.updated_parsed = tuple UTC
    # calendar.timegm = seconds UTC
    # time.localtime = tuple locale
    print time.strftime("%Y-%m-%d %H:%M",
            time.localtime(calendar.timegm(e.updated_parsed)))
    print e.rdf_value # Author
    print e.title
    print

Read More

Next:
Previous:
Categories: Python, Technical

Response

June 11th, 2009

Mike B.

Ugh! Single character variable names in python! Bad!

Comment

Leave a comment . . .

Tiny Print:

  1. For private messages, e-mail me: dannyman@toldme.com.
  2. You must provide an e-mail address.
  3. You can use a bogus e-mail address, but I like to know who you are.
  4. I will not spam you. I will not publish or share your e-mail address.
  5. First-time commenters will be held for review.
  6. You can use these HTML tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>