Store only last 20 articles for ecrans backend

This commit is contained in:
Florent 2012-03-05 13:44:44 +01:00 committed by Romain Bignon
commit 03c775efa1
2 changed files with 37 additions and 4 deletions

View file

@ -33,7 +33,12 @@ def id2url(_id):
def url2id(url):
"return an id from an url"
return url
regexp = re.compile("(^.*),([0-9]+)\.html$")
match = regexp.match(url)
if match:
return match.group(2)
else:
raise ValueError("Can't find an id for the url")
def rssid(entry):
return url2id(entry.id)