Name | Modified | Size | Downloads / Week |
---|---|---|---|
Parent folder | |||
Feed examination helper tool.tar.gz | 2016-10-11 | 109.2 kB | |
Feed examination helper tool.zip | 2016-10-11 | 110.9 kB | |
README.md | 2016-10-11 | 2.0 kB | |
Totals: 3 Items | 222.1 kB | 0 |
Manually examining what's in a feed to figure out available fields is a pain. The feedparser library also does some extra processing that can change the names of some fields and really keep you guessing. You could always turn up the debug levels, but that's also a bit of a pain. To help with this, I've added a helpful "show_sample_entry" tool that can help show you what fields are available to the bot.
Running it:
$ ./show_sample_entry.py https://github.com/freiheit/discord_feedbot/releases.atom
Sample output:
:::python
# We currently restrict this output to depth=1,
# because that's all the bot can currently handle.
# So, ignore those `[...]` and `{...}` structures and only look at 'strings'.
{ 'author': 'freiheit',
'author_detail': {...},
'authors': [...],
'content': [...],
'guidislink': True,
'href': '',
'id': 'tag:github.com,2008:Repository/50977510/v2.1.1',
'link': 'https://github.com/freiheit/discord_feedbot/releases/tag/v2.1.1',
'links': [...],
'media_thumbnail': [...],
'summary': "<p>Manually examining what's in a feed to figure out "
'available fields is a pain. The feedparser library also does '
# [ ... edited for length ...]
'<h3>Fields I can see are usable:</h3>\n'
'\n'
'<div class="highlight highlight-source-ini"><pre><span '
'class="pl-k">fields</span> = author, id, link, summary, '
'title, updated</pre></div>',
'title': 'Feed examination helper tool',
'title_detail': {...},
'updated': '2016-10-11T21:54:12Z',
'updated_parsed': time.struct_time(tm_year=2016, tm_mon=10, tm_mday=11, tm_hour=21, tm_min=54, tm_sec=12, tm_wday=1, tm_yday=285, tm_isdst=0)}
Fields I can see are usable:
:::ini
fields = author, id, link, summary, title, updated