mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Update Art and Letters Daily
This commit is contained in:
parent
43f8e0926d
commit
1a7a1b27e8
@ -8,10 +8,9 @@ Recipe for Arts and Letters Daily website
|
|||||||
|
|
||||||
from calibre.web.feeds.news import BasicNewsRecipe
|
from calibre.web.feeds.news import BasicNewsRecipe
|
||||||
import re
|
import re
|
||||||
from datetime import date as dt
|
from datetime import date as dt, timedelta
|
||||||
from datetime import timedelta
|
|
||||||
from datetime import datetime
|
|
||||||
from itertools import compress
|
from itertools import compress
|
||||||
|
from calibre.utils.date import parse_date
|
||||||
|
|
||||||
|
|
||||||
class ALD(BasicNewsRecipe):
|
class ALD(BasicNewsRecipe):
|
||||||
@ -44,7 +43,7 @@ class ALD(BasicNewsRecipe):
|
|||||||
date_list.append(self.tag_to_string(div))
|
date_list.append(self.tag_to_string(div))
|
||||||
date_list_clean = [re.sub(r'[^\w]', ' ', date) for date in date_list]
|
date_list_clean = [re.sub(r'[^\w]', ' ', date) for date in date_list]
|
||||||
date_list_bool = [
|
date_list_bool = [
|
||||||
datetime.strptime(date, '%b %d %Y').date() >= oldest_date
|
parse_date(date).date() >= oldest_date
|
||||||
for date in date_list_clean
|
for date in date_list_clean
|
||||||
]
|
]
|
||||||
compress_date = list(compress(date_list, date_list_bool))
|
compress_date = list(compress(date_list, date_list_bool))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user