Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
executable file 29 lines (23 sloc) 839 Bytes
#!/usr/bin/env python
from rdflib.Graph import Graph
from rdflib.URIRef import URIRef as URI
from sparta import ThingFactory
import textwrap
indent = textwrap.TextWrapper(initial_indent=" ", subsequent_indent=" ").fill
def main(rss_url, blog_uri):
store, schema_store = Graph(), Graph()
store.bind('rss', '')
Thing = ThingFactory(store, schema_store)
blog = Thing(URI(blog_uri))
for item in blog.rss_items:
print "*", item.rss_title
print indent(item.rss_description)
if __name__ == '__main__':
import sys
main(sys.argv[1], sys.argv[2])
except IndexError:
sys.stderr.write("Usage: %s [RSS feed URL] [Blog URI]\n" % sys.argv[0])
Something went wrong with that request. Please try again.