forum: remember last post date instead of all ids
The current implementation remembers the post ids. It sometimes announces old posts if a new one is deleted and old unknown posts show up at the feed bottom.
An feed entry provides the published and published_parsed attributes. They can be used to identify new posts.
>> import feedparser
>> f = feedparser.parse('https://forum.finf.uni-hannover.de/index.php?page=GlobalFeed&format=rss2')
>> e = f.entries[0]
>> e.published??
Type: str
String form: Sat, 22 Jul 2017 11:10:11 +0000
Length: 31
>> e.published_parsed?
Type: struct_time
String form: time.struct_time(tm_year=2017, tm_mon=7, tm_mday=22, tm_hour=11, tm_min=10, tm_sec=11, tm_wday=5, tm_yday=203, tm_isdst=0)
Length: 9
Docstring:
The time value as returned by gmtime(), localtime(), and strptime(), and
accepted by asctime(), mktime() and strftime(). May be considered as a
sequence of 9 integers.
Note that several fields' values are not the same as those defined by
the C language standard for struct tm. For example, the value of the
field tm_year is the actual year, not year - 1900. See individual
fields' descriptions for details.
see https://docs.python.org/3.6/library/time.html#time.struct_time
Edited by Fjen Undso