root / atomisator / doc / sources.txt

Revision 89:dd1daf2a2d4c, 0.6 kB (checked in by Tarek Ziad?? <tarek@…>, 17 months ago)

added a first source reader

Line 
1=======
2sources
3=======
4
5All kind of sources can be read, and new readers registered.
6The system provides for example an RSS reader.
7
8We have a rss file to test::
9
10    >>> from sources import sourcing
11    >>> import os
12    >>> dirname = os.path.dirname(sourcing.__file__)
13    >>> dirname = os.path.split(dirname)[0]
14    >>> location = os.path.join(dirname, 'tests', 'feed.xml')
15
16Let's try to read it::
17
18    >>> targets = (('rss', location),)
19    >>> entries = sourcing.get_entries(targets)
20    >>> res = entries.next()
21    >>> len(res)
22    165
23    >>> res[0]['content']
24    u"CSSEdit 2 is a major upgrade ... check it out!"
25
Note: See TracBrowser for help on using the browser.