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

Discover more from dannyman.toldme.com

Subscribe now to keep reading and get access to the full archive.

Continue reading