Get real ID directly with url2id
This commit is contained in:
parent
72c230e81d
commit
f9f0bc26b0
1 changed files with 7 additions and 7 deletions
|
|
@ -23,13 +23,13 @@ import re
|
||||||
|
|
||||||
def url2id(url):
|
def url2id(url):
|
||||||
"return an id from an url"
|
"return an id from an url"
|
||||||
regexp = re.compile(".*/([0-9]+)-.*")
|
if "/today/" in entry.link:
|
||||||
id = regexp.match(url).group(1)
|
return link.split("#")[1]
|
||||||
return id
|
else:
|
||||||
|
regexp = re.compile(".*/([0-9]+)-.*")
|
||||||
|
id = regexp.match(url).group(1)
|
||||||
|
return id
|
||||||
|
|
||||||
|
|
||||||
def rssid(entry):
|
def rssid(entry):
|
||||||
if "/today/" in entry.link:
|
return url2id(entry.link)
|
||||||
return entry.link.split("#")[1]
|
|
||||||
else:
|
|
||||||
return url2id(entry.link)
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue