mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Merge branch 'master' of https://github.com/unkn0w7n/calibre
This commit is contained in:
commit
c9fefbcd54
@ -1,3 +1,5 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
# vim:fileencoding=utf-8
|
||||||
'''
|
'''
|
||||||
https://ancientegyptmagazine.com
|
https://ancientegyptmagazine.com
|
||||||
'''
|
'''
|
||||||
|
@ -234,6 +234,20 @@ class BBCNews(BasicNewsRecipe):
|
|||||||
#
|
#
|
||||||
oldest_article = 1.5
|
oldest_article = 1.5
|
||||||
|
|
||||||
|
recipe_specific_options = {
|
||||||
|
'days': {
|
||||||
|
'short': 'Oldest article to download from this news source. In days ',
|
||||||
|
'long': 'For example, 0.5, gives you articles from the past 12 hours',
|
||||||
|
'default': str(oldest_article)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
def __init__(self, *args, **kwargs):
|
||||||
|
BasicNewsRecipe.__init__(self, *args, **kwargs)
|
||||||
|
d = self.recipe_specific_options.get('days')
|
||||||
|
if d and isinstance(d, str):
|
||||||
|
self.oldest_article = float(d)
|
||||||
|
|
||||||
# Number of simultaneous downloads. 20 is consistently working fine on the
|
# Number of simultaneous downloads. 20 is consistently working fine on the
|
||||||
# BBC News feeds with no problems. Speeds things up from the default of 5.
|
# BBC News feeds with no problems. Speeds things up from the default of 5.
|
||||||
# If you have a lot of feeds and/or have increased oldest_article above 2
|
# If you have a lot of feeds and/or have increased oldest_article above 2
|
||||||
|
@ -1,3 +1,6 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
# vim:fileencoding=utf-8
|
||||||
|
|
||||||
import json
|
import json
|
||||||
import time
|
import time
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
@ -58,7 +61,7 @@ class Bloomberg(BasicNewsRecipe):
|
|||||||
remove_empty_feeds = True
|
remove_empty_feeds = True
|
||||||
|
|
||||||
recipe_specific_options = {
|
recipe_specific_options = {
|
||||||
'date': {
|
'issue': {
|
||||||
'short': 'The ID of the edition to download (YY_XX format)',
|
'short': 'The ID of the edition to download (YY_XX format)',
|
||||||
'long': 'For example, 24_17\nHint: Edition ID can be found at the end of its URL'
|
'long': 'For example, 24_17\nHint: Edition ID can be found at the end of its URL'
|
||||||
}
|
}
|
||||||
@ -86,7 +89,7 @@ class Bloomberg(BasicNewsRecipe):
|
|||||||
inx = 'https://cdn-mobapi.bloomberg.com'
|
inx = 'https://cdn-mobapi.bloomberg.com'
|
||||||
sec = self.index_to_soup(inx + '/wssmobile/v1/bw/news/list?limit=1', raw=True)
|
sec = self.index_to_soup(inx + '/wssmobile/v1/bw/news/list?limit=1', raw=True)
|
||||||
id = json.loads(sec)['magazines'][0]['id']
|
id = json.loads(sec)['magazines'][0]['id']
|
||||||
past_edition = self.recipe_specific_options.get('date')
|
past_edition = self.recipe_specific_options.get('issue')
|
||||||
if past_edition and isinstance(past_edition, str):
|
if past_edition and isinstance(past_edition, str):
|
||||||
id = past_edition
|
id = past_edition
|
||||||
edit = self.index_to_soup(inx + '/wssmobile/v1/bw/news/week/' + id, raw=True)
|
edit = self.index_to_soup(inx + '/wssmobile/v1/bw/news/week/' + id, raw=True)
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
# vim:fileencoding=utf-8
|
||||||
import json
|
import json
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
# vim:fileencoding=utf-8
|
||||||
import json
|
import json
|
||||||
import re
|
import re
|
||||||
from datetime import date, datetime, timedelta
|
from datetime import date, datetime, timedelta
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
# vim:fileencoding=utf-8
|
||||||
import re
|
import re
|
||||||
from datetime import datetime, timedelta
|
from datetime import datetime, timedelta
|
||||||
from urllib.parse import quote
|
from urllib.parse import quote
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
# vim:fileencoding=utf-8
|
||||||
'''
|
'''
|
||||||
http://www.elcorreo.com/
|
http://www.elcorreo.com/
|
||||||
'''
|
'''
|
||||||
@ -22,6 +24,20 @@ class elcorreo(BasicNewsRecipe):
|
|||||||
max_articles_per_feed = 25 # articles
|
max_articles_per_feed = 25 # articles
|
||||||
compress_news_images = True
|
compress_news_images = True
|
||||||
|
|
||||||
|
recipe_specific_options = {
|
||||||
|
'days': {
|
||||||
|
'short': 'Oldest article to download from this news source. In days ',
|
||||||
|
'long': 'For example, 0.5, gives you articles from the past 12 hours',
|
||||||
|
'default': str(oldest_article)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
def __init__(self, *args, **kwargs):
|
||||||
|
BasicNewsRecipe.__init__(self, *args, **kwargs)
|
||||||
|
d = self.recipe_specific_options.get('days')
|
||||||
|
if d and isinstance(d, str):
|
||||||
|
self.oldest_article = float(d)
|
||||||
|
|
||||||
extra_css = '''
|
extra_css = '''
|
||||||
.v-mdl-ath__inf, .v-mdl-ath__p--2, .v-mdl-ath__p {font-size:small; color:#404040;}
|
.v-mdl-ath__inf, .v-mdl-ath__p--2, .v-mdl-ath__p {font-size:small; color:#404040;}
|
||||||
.v-fc, .v-a-fig { text-align:center; font-size:small; }
|
.v-fc, .v-a-fig { text-align:center; font-size:small; }
|
||||||
|
@ -27,6 +27,20 @@ class ElPais(BasicNewsRecipe):
|
|||||||
oldest_article = 2.1
|
oldest_article = 2.1
|
||||||
max_articles_per_feed = 25
|
max_articles_per_feed = 25
|
||||||
|
|
||||||
|
recipe_specific_options = {
|
||||||
|
'days': {
|
||||||
|
'short': 'Oldest article to download from this news source. In days ',
|
||||||
|
'long': 'For example, 0.5, gives you articles from the past 12 hours',
|
||||||
|
'default': str(oldest_article)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
def __init__(self, *args, **kwargs):
|
||||||
|
BasicNewsRecipe.__init__(self, *args, **kwargs)
|
||||||
|
d = self.recipe_specific_options.get('days')
|
||||||
|
if d and isinstance(d, str):
|
||||||
|
self.oldest_article = float(d)
|
||||||
|
|
||||||
use_embedded_content = False
|
use_embedded_content = False
|
||||||
recursion = 5
|
recursion = 5
|
||||||
|
|
||||||
|
@ -19,6 +19,20 @@ class EpochTimes(BasicNewsRecipe):
|
|||||||
masthead_url = 'https://epochtimes-ny.newsmemory.com/eeLayout/epochtimes/1.0.a/images/webapp/banner.png'
|
masthead_url = 'https://epochtimes-ny.newsmemory.com/eeLayout/epochtimes/1.0.a/images/webapp/banner.png'
|
||||||
extra_css = '.post_caption, .text-sm, .uppercase {font-size:small;}'
|
extra_css = '.post_caption, .text-sm, .uppercase {font-size:small;}'
|
||||||
|
|
||||||
|
recipe_specific_options = {
|
||||||
|
'days': {
|
||||||
|
'short': 'Oldest article to download from this news source. In days ',
|
||||||
|
'long': 'For example, 0.5, gives you articles from the past 12 hours',
|
||||||
|
'default': str(oldest_article)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
def __init__(self, *args, **kwargs):
|
||||||
|
BasicNewsRecipe.__init__(self, *args, **kwargs)
|
||||||
|
d = self.recipe_specific_options.get('days')
|
||||||
|
if d and isinstance(d, str):
|
||||||
|
self.oldest_article = float(d)
|
||||||
|
|
||||||
keep_only_tags = [
|
keep_only_tags = [
|
||||||
dict(name='article')
|
dict(name='article')
|
||||||
]
|
]
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
# vim:fileencoding=utf-8
|
||||||
import json
|
import json
|
||||||
import re
|
import re
|
||||||
from urllib.parse import quote
|
from urllib.parse import quote
|
||||||
@ -31,6 +33,20 @@ class ft(BasicNewsRecipe):
|
|||||||
.o-topper__topic { font-size:small; color:#5c5c5c; }
|
.o-topper__topic { font-size:small; color:#5c5c5c; }
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
recipe_specific_options = {
|
||||||
|
'days': {
|
||||||
|
'short': 'Oldest article to download from this news source. In days ',
|
||||||
|
'long': 'For example, 0.5, gives you articles from the past 12 hours',
|
||||||
|
'default': str(oldest_article)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
def __init__(self, *args, **kwargs):
|
||||||
|
BasicNewsRecipe.__init__(self, *args, **kwargs)
|
||||||
|
d = self.recipe_specific_options.get('days')
|
||||||
|
if d and isinstance(d, str):
|
||||||
|
self.oldest_article = float(d)
|
||||||
|
|
||||||
keep_only_tags = [
|
keep_only_tags = [
|
||||||
classes(
|
classes(
|
||||||
'body_json o-topper__topic o-topper__headline o-topper__standfirst o-topper__visual article-info__time-byline main-image'
|
'body_json o-topper__topic o-topper__headline o-topper__standfirst o-topper__visual article-info__time-byline main-image'
|
||||||
|
@ -47,8 +47,20 @@ class ForeignPolicy(BasicNewsRecipe):
|
|||||||
]
|
]
|
||||||
remove_tags_after = [classes('post-content-main')]
|
remove_tags_after = [classes('post-content-main')]
|
||||||
|
|
||||||
|
recipe_specific_options = {
|
||||||
|
'issue': {
|
||||||
|
'short': 'Enter the Issue ID you want to download ',
|
||||||
|
'long': 'For example, 411131563'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
def parse_index(self):
|
def parse_index(self):
|
||||||
soup = self.index_to_soup('https://foreignpolicy.com/the-magazine')
|
issue_url = 'https://foreignpolicy.com/the-magazine'
|
||||||
|
d = self.recipe_specific_options.get('issue')
|
||||||
|
if d and isinstance(d, str):
|
||||||
|
issue_url = issue_url + '/?issue_id=' + d
|
||||||
|
|
||||||
|
soup = self.index_to_soup(issue_url)
|
||||||
img = soup.find('img', attrs={'src': lambda x: x and '-cover' in x})
|
img = soup.find('img', attrs={'src': lambda x: x and '-cover' in x})
|
||||||
if img:
|
if img:
|
||||||
self.cover_url = img['src'].split('?')[0] + '?w=800?quality=90'
|
self.cover_url = img['src'].split('?')[0] + '?w=800?quality=90'
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
# vim:fileencoding=utf-8
|
||||||
from datetime import datetime, timedelta, timezone
|
from datetime import datetime, timedelta, timezone
|
||||||
|
|
||||||
from calibre.utils.date import parse_date
|
from calibre.utils.date import parse_date
|
||||||
@ -29,6 +31,20 @@ class GlobalTimes(BasicNewsRecipe):
|
|||||||
blockquote, em {color:#202020;}
|
blockquote, em {color:#202020;}
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
recipe_specific_options = {
|
||||||
|
'days': {
|
||||||
|
'short': 'Oldest article to download from this news source. In days ',
|
||||||
|
'long': 'For example, 0.5, gives you articles from the past 12 hours',
|
||||||
|
'default': str(oldest_article)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
def __init__(self, *args, **kwargs):
|
||||||
|
BasicNewsRecipe.__init__(self, *args, **kwargs)
|
||||||
|
d = self.recipe_specific_options.get('days')
|
||||||
|
if d and isinstance(d, str):
|
||||||
|
self.oldest_article = float(d)
|
||||||
|
|
||||||
keep_only_tags = [
|
keep_only_tags = [
|
||||||
classes(
|
classes(
|
||||||
'article_column article_title author_share_left article_content'
|
'article_column article_title author_share_left article_content'
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
# vim:fileencoding=utf-8
|
||||||
'''
|
'''
|
||||||
harpers.org
|
harpers.org
|
||||||
'''
|
'''
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
# vim:fileencoding=utf-8
|
||||||
import json
|
import json
|
||||||
|
|
||||||
from calibre.web.feeds.news import BasicNewsRecipe
|
from calibre.web.feeds.news import BasicNewsRecipe
|
||||||
@ -37,6 +39,20 @@ class himal(BasicNewsRecipe):
|
|||||||
resolve_internal_links = True
|
resolve_internal_links = True
|
||||||
oldest_article = 30 # days
|
oldest_article = 30 # days
|
||||||
|
|
||||||
|
recipe_specific_options = {
|
||||||
|
'days': {
|
||||||
|
'short': 'Oldest article to download from this news source. In days ',
|
||||||
|
'long': 'For example, 0.5, gives you articles from the past 12 hours',
|
||||||
|
'default': str(oldest_article)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
def __init__(self, *args, **kwargs):
|
||||||
|
BasicNewsRecipe.__init__(self, *args, **kwargs)
|
||||||
|
d = self.recipe_specific_options.get('days')
|
||||||
|
if d and isinstance(d, str):
|
||||||
|
self.oldest_article = float(d)
|
||||||
|
|
||||||
extra_css = '''
|
extra_css = '''
|
||||||
.cap, .auth {font-size:small;}
|
.cap, .auth {font-size:small;}
|
||||||
em, blockquote {color:#404040;}
|
em, blockquote {color:#404040;}
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
# vim:fileencoding=utf-8
|
||||||
import json
|
import json
|
||||||
import re
|
import re
|
||||||
from collections import defaultdict
|
from collections import defaultdict
|
||||||
@ -32,7 +34,7 @@ class TheHindu(BasicNewsRecipe):
|
|||||||
recipe_specific_options = {
|
recipe_specific_options = {
|
||||||
'location': {
|
'location': {
|
||||||
'short': 'The name of the local edition',
|
'short': 'The name of the local edition',
|
||||||
'long': 'If The Hindu is available in your local town/city,\nset this to your location, for example, hyderabad',
|
'long': 'If The Hindu is available in your local town/city,\nset this to your location, for example, hyderabad\nAvailable Editions: bengaluru, chennai, coimbatore, delhi, erode, hyderabad, international, kochi, kolkata,\nkozhikode, madurai, mangalore, mumbai, thiruvananthapuram, tiruchirapalli, vijayawada, visakhapatnam',
|
||||||
'default': 'international'
|
'default': 'international'
|
||||||
},
|
},
|
||||||
'date': {
|
'date': {
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
# vim:fileencoding=utf-8
|
||||||
from datetime import date
|
from datetime import date
|
||||||
|
|
||||||
from calibre.web.feeds.news import BasicNewsRecipe, classes
|
from calibre.web.feeds.news import BasicNewsRecipe, classes
|
||||||
@ -24,6 +26,20 @@ class TheHindufeeds(BasicNewsRecipe):
|
|||||||
.italic {font-style:italic; color:#202020;}
|
.italic {font-style:italic; color:#202020;}
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
recipe_specific_options = {
|
||||||
|
'days': {
|
||||||
|
'short': 'Oldest article to download from this news source. In days ',
|
||||||
|
'long': 'For example, 0.5, gives you articles from the past 12 hours',
|
||||||
|
'default': str(oldest_article)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
def __init__(self, *args, **kwargs):
|
||||||
|
BasicNewsRecipe.__init__(self, *args, **kwargs)
|
||||||
|
d = self.recipe_specific_options.get('days')
|
||||||
|
if d and isinstance(d, str):
|
||||||
|
self.oldest_article = float(d)
|
||||||
|
|
||||||
ignore_duplicate_articles = {'url'}
|
ignore_duplicate_articles = {'url'}
|
||||||
|
|
||||||
keep_only_tags = [
|
keep_only_tags = [
|
||||||
|
@ -1,20 +1,11 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
# vim:fileencoding=utf-8
|
||||||
import json
|
import json
|
||||||
from collections import defaultdict
|
from collections import defaultdict
|
||||||
from datetime import date
|
from datetime import date
|
||||||
|
|
||||||
from calibre.web.feeds.news import BasicNewsRecipe
|
from calibre.web.feeds.news import BasicNewsRecipe
|
||||||
|
|
||||||
# figure out your local_edition from the fetch news log of this recipe
|
|
||||||
local_edition = 'Delhi'
|
|
||||||
|
|
||||||
today = date.today().strftime('%d/%m/%Y')
|
|
||||||
|
|
||||||
# for older edition, change today
|
|
||||||
# today = '22/12/2023'
|
|
||||||
|
|
||||||
day, month, year = (int(x) for x in today.split('/'))
|
|
||||||
dt = date(year, month, day)
|
|
||||||
today = today.replace('/', '%2F')
|
|
||||||
|
|
||||||
index = 'https://epaper.hindustantimes.com'
|
index = 'https://epaper.hindustantimes.com'
|
||||||
|
|
||||||
@ -23,28 +14,49 @@ class ht(BasicNewsRecipe):
|
|||||||
language = 'en_IN'
|
language = 'en_IN'
|
||||||
__author__ = 'unkn0wn'
|
__author__ = 'unkn0wn'
|
||||||
masthead_url = 'https://www.htmedia.in/wp-content/uploads/2020/08/HT-dot-com-logo-product.png'
|
masthead_url = 'https://www.htmedia.in/wp-content/uploads/2020/08/HT-dot-com-logo-product.png'
|
||||||
timefmt = ' [' + dt.strftime('%b %d, %Y') + ']'
|
|
||||||
description = 'Articles from the Hindustan Times epaper, digital edition'
|
description = 'Articles from the Hindustan Times epaper, digital edition'
|
||||||
encoding = 'utf-8'
|
encoding = 'utf-8'
|
||||||
delay = 1
|
delay = 1
|
||||||
ignore_duplicate_articles = {'title'}
|
ignore_duplicate_articles = {'title'}
|
||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
|
||||||
BasicNewsRecipe.__init__(self, *args, **kwargs)
|
|
||||||
if self.output_profile.short_name.startswith('kindle'):
|
|
||||||
self.title = 'HT Print Edition ' + dt.strftime('%b %d, %Y')
|
|
||||||
|
|
||||||
extra_css = '''
|
extra_css = '''
|
||||||
.cap { text-align:center; font-size:small; }
|
.cap { text-align:center; font-size:small; }
|
||||||
img { display:block; margin:0 auto; }
|
img { display:block; margin:0 auto; }
|
||||||
'''
|
'''
|
||||||
|
|
||||||
def parse_index(self):
|
recipe_specific_options = {
|
||||||
|
'location': {
|
||||||
|
'short': 'The name of the local edition',
|
||||||
|
'long': 'If The Hindustan Times is available in your local town/city,\nset this to your location, for example, Delhi\nAvailable Editions: Delhi, Mumbai, Chandigarh, Lucknow, Patna, Bengaluru, Pune, Gurgaon, Ludhiana, Rajasthan, Amritsar,\nEast UP, Haryana, Jammu, Navi Mumbai, Noida, Punjab, Ranchi, Thane, Uttarakhand, West UP',
|
||||||
|
'default': 'Delhi'
|
||||||
|
},
|
||||||
|
'date': {
|
||||||
|
'short': 'The date of the edition to download (DD/MM/YYYY format)',
|
||||||
|
'long': 'For example, 22/12/2023'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
def parse_index(self):
|
||||||
self.log(
|
self.log(
|
||||||
'\n***\nif this recipe fails, report it on: '
|
'\n***\nif this recipe fails, report it on: '
|
||||||
'https://www.mobileread.com/forums/forumdisplay.php?f=228\n***\n'
|
'https://www.mobileread.com/forums/forumdisplay.php?f=228\n***\n'
|
||||||
)
|
)
|
||||||
|
local_edition = 'Delhi'
|
||||||
|
d = self.recipe_specific_options.get('location')
|
||||||
|
if d and isinstance(d, str):
|
||||||
|
local_edition = d
|
||||||
|
|
||||||
|
today = date.today().strftime('%d/%m/%Y')
|
||||||
|
|
||||||
|
p = self.recipe_specific_options.get('date')
|
||||||
|
if p and isinstance(p, str):
|
||||||
|
today = p
|
||||||
|
|
||||||
|
self.timefmt = ' [%s]' % today
|
||||||
|
|
||||||
|
day, month, year = (int(x) for x in today.split('/'))
|
||||||
|
dt = date(year, month, day)
|
||||||
|
today = today.replace('/', '%2F')
|
||||||
|
|
||||||
get_edition = index + '/Home/GetEditionSupplementHierarchy?EditionDate=' + today
|
get_edition = index + '/Home/GetEditionSupplementHierarchy?EditionDate=' + today
|
||||||
edi_data = json.loads(self.index_to_soup(get_edition, raw=True))
|
edi_data = json.loads(self.index_to_soup(get_edition, raw=True))
|
||||||
@ -56,7 +68,7 @@ class ht(BasicNewsRecipe):
|
|||||||
if edi['EditionName'] == local_edition:
|
if edi['EditionName'] == local_edition:
|
||||||
edi_name = edi['EditionName']
|
edi_name = edi['EditionName']
|
||||||
edi_id = str(edi['EditionId'])
|
edi_id = str(edi['EditionId'])
|
||||||
self.log('Downloading', edi_name, 'Edition')
|
self.log('Downloading', edi_name, 'Edition', self.timefmt)
|
||||||
|
|
||||||
url = index + '/Home/GetAllpages?editionid=' + edi_id + '&editiondate=' + today
|
url = index + '/Home/GetAllpages?editionid=' + edi_id + '&editiondate=' + today
|
||||||
main_data = json.loads(self.index_to_soup(url, raw=True))
|
main_data = json.loads(self.index_to_soup(url, raw=True))
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
# vim:fileencoding=utf-8
|
||||||
|
|
||||||
from calibre.ebooks.BeautifulSoup import Tag
|
from calibre.ebooks.BeautifulSoup import Tag
|
||||||
from calibre.web.feeds.news import BasicNewsRecipe
|
from calibre.web.feeds.news import BasicNewsRecipe
|
||||||
|
@ -36,6 +36,20 @@ class LeMonde(BasicNewsRecipe):
|
|||||||
'publisher': publisher
|
'publisher': publisher
|
||||||
}
|
}
|
||||||
|
|
||||||
|
recipe_specific_options = {
|
||||||
|
'days': {
|
||||||
|
'short': 'Oldest article to download from this news source. In days ',
|
||||||
|
'long': 'For example, 0.5, gives you articles from the past 12 hours',
|
||||||
|
'default': str(oldest_article)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
def __init__(self, *args, **kwargs):
|
||||||
|
BasicNewsRecipe.__init__(self, *args, **kwargs)
|
||||||
|
d = self.recipe_specific_options.get('days')
|
||||||
|
if d and isinstance(d, str):
|
||||||
|
self.oldest_article = float(d)
|
||||||
|
|
||||||
masthead_url = 'http://upload.wikimedia.org/wikipedia/commons/thumb/5/54/Le_monde_logo.svg/800px-Le_monde_logo.svg.png'
|
masthead_url = 'http://upload.wikimedia.org/wikipedia/commons/thumb/5/54/Le_monde_logo.svg/800px-Le_monde_logo.svg.png'
|
||||||
|
|
||||||
feeds = [
|
feeds = [
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
# vim:fileencoding=utf-8
|
# vim:fileencoding=utf-8
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
@ -33,6 +34,20 @@ class LeMondeDiplomatiqueSiteWeb(BasicNewsRecipe):
|
|||||||
timefmt = ' [%d %b %Y]'
|
timefmt = ' [%d %b %Y]'
|
||||||
no_stylesheets = True
|
no_stylesheets = True
|
||||||
|
|
||||||
|
recipe_specific_options = {
|
||||||
|
'days': {
|
||||||
|
'short': 'Oldest article to download from this news source. In days ',
|
||||||
|
'long': 'For example, 0.5, gives you articles from the past 12 hours',
|
||||||
|
'default': str(oldest_article)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
def __init__(self, *args, **kwargs):
|
||||||
|
BasicNewsRecipe.__init__(self, *args, **kwargs)
|
||||||
|
d = self.recipe_specific_options.get('days')
|
||||||
|
if d and isinstance(d, str):
|
||||||
|
self.oldest_article = float(d)
|
||||||
|
|
||||||
feeds = [(u'Blogs', u'http://blog.mondediplo.net/spip.php?page=backend'),
|
feeds = [(u'Blogs', u'http://blog.mondediplo.net/spip.php?page=backend'),
|
||||||
(u'Archives', u'http://www.monde-diplomatique.fr/rss/')]
|
(u'Archives', u'http://www.monde-diplomatique.fr/rss/')]
|
||||||
|
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
# vim:fileencoding=utf-8
|
||||||
from calibre.web.feeds.news import BasicNewsRecipe
|
from calibre.web.feeds.news import BasicNewsRecipe
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
# vim:fileencoding=utf-8
|
||||||
'''
|
'''
|
||||||
liberation.fr
|
liberation.fr
|
||||||
'''
|
'''
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
# vim:fileencoding=utf-8
|
||||||
import json
|
import json
|
||||||
import re
|
import re
|
||||||
from datetime import date
|
from datetime import date
|
||||||
@ -35,10 +37,6 @@ class LiveMint(BasicNewsRecipe):
|
|||||||
d = self.recipe_specific_options.get('days')
|
d = self.recipe_specific_options.get('days')
|
||||||
if d and isinstance(d, str):
|
if d and isinstance(d, str):
|
||||||
self.oldest_article = float(d)
|
self.oldest_article = float(d)
|
||||||
if self.output_profile.short_name.startswith('kindle'):
|
|
||||||
self.title = 'Mint | ' + date.today().strftime('%b %d, %Y')
|
|
||||||
if is_saturday:
|
|
||||||
self.title = 'Mint Lounge | ' + date.today().strftime('%b %d, %Y')
|
|
||||||
|
|
||||||
def get_cover_url(self):
|
def get_cover_url(self):
|
||||||
today = date.today().strftime('%d/%m/%Y')
|
today = date.today().strftime('%d/%m/%Y')
|
||||||
@ -51,7 +49,7 @@ class LiveMint(BasicNewsRecipe):
|
|||||||
return cov['HighResolution']
|
return cov['HighResolution']
|
||||||
|
|
||||||
if is_saturday:
|
if is_saturday:
|
||||||
|
self.title = 'Mint Lounge'
|
||||||
masthead_url = 'https://lifestyle.livemint.com/mintlounge/static-images/lounge-logo.svg'
|
masthead_url = 'https://lifestyle.livemint.com/mintlounge/static-images/lounge-logo.svg'
|
||||||
|
|
||||||
oldest_article = 6.5 # days
|
oldest_article = 6.5 # days
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
# vim:fileencoding=utf-8
|
||||||
'''
|
'''
|
||||||
https://www.military-history.org/
|
https://www.military-history.org/
|
||||||
'''
|
'''
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
# vim:fileencoding=utf-8
|
||||||
'''
|
'''
|
||||||
https://minervamagazine.com/
|
https://minervamagazine.com/
|
||||||
'''
|
'''
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
# vim:fileencoding=utf-8
|
||||||
from calibre.web.feeds.news import BasicNewsRecipe, classes
|
from calibre.web.feeds.news import BasicNewsRecipe, classes
|
||||||
|
|
||||||
|
|
||||||
|
@ -27,6 +27,20 @@ class Politico(BasicNewsRecipe):
|
|||||||
encoding = 'UTF-8'
|
encoding = 'UTF-8'
|
||||||
language = 'en'
|
language = 'en'
|
||||||
|
|
||||||
|
recipe_specific_options = {
|
||||||
|
'days': {
|
||||||
|
'short': 'Oldest article to download from this news source. In days ',
|
||||||
|
'long': 'For example, 0.5, gives you articles from the past 12 hours',
|
||||||
|
'default': str(oldest_article)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
def __init__(self, *args, **kwargs):
|
||||||
|
BasicNewsRecipe.__init__(self, *args, **kwargs)
|
||||||
|
d = self.recipe_specific_options.get('days')
|
||||||
|
if d and isinstance(d, str):
|
||||||
|
self.oldest_article = float(d)
|
||||||
|
|
||||||
remove_empty_feeds = True
|
remove_empty_feeds = True
|
||||||
ignore_duplicate_articles = ['url']
|
ignore_duplicate_articles = ['url']
|
||||||
|
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
# vim:fileencoding=utf-8
|
||||||
import json
|
import json
|
||||||
import time
|
import time
|
||||||
from datetime import datetime, timedelta
|
from datetime import datetime, timedelta
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
# vim:fileencoding=utf-8
|
||||||
'''
|
'''
|
||||||
rt.com
|
rt.com
|
||||||
'''
|
'''
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
# vim:fileencoding=utf-8
|
||||||
from calibre.web.feeds.news import BasicNewsRecipe, classes
|
from calibre.web.feeds.news import BasicNewsRecipe, classes
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
# vim:fileencoding=utf-8
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
|
||||||
from calibre.web.feeds.news import BasicNewsRecipe, classes
|
from calibre.web.feeds.news import BasicNewsRecipe, classes
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
# vim:fileencoding=utf-8
|
||||||
import json
|
import json
|
||||||
import re
|
import re
|
||||||
|
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
# vim:fileencoding=utf-8
|
||||||
__license__ = 'GPL v3'
|
__license__ = 'GPL v3'
|
||||||
__copyright__ = '2011, Darko Miletic <darko.miletic at gmail.com>'
|
__copyright__ = '2011, Darko Miletic <darko.miletic at gmail.com>'
|
||||||
'''
|
'''
|
||||||
@ -28,6 +30,20 @@ class TheWashingtonPost(BasicNewsRecipe):
|
|||||||
publication_type = 'newspaper'
|
publication_type = 'newspaper'
|
||||||
remove_attributes = ['style', 'width', 'height']
|
remove_attributes = ['style', 'width', 'height']
|
||||||
|
|
||||||
|
recipe_specific_options = {
|
||||||
|
'days': {
|
||||||
|
'short': 'Oldest article to download from this news source. In days ',
|
||||||
|
'long': 'For example, 0.5, gives you articles from the past 12 hours',
|
||||||
|
'default': str(oldest_article)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
def __init__(self, *args, **kwargs):
|
||||||
|
BasicNewsRecipe.__init__(self, *args, **kwargs)
|
||||||
|
d = self.recipe_specific_options.get('days')
|
||||||
|
if d and isinstance(d, str):
|
||||||
|
self.oldest_article = float(d)
|
||||||
|
|
||||||
extra_css = '''
|
extra_css = '''
|
||||||
.img { text-align:center; font-size:small; }
|
.img { text-align:center; font-size:small; }
|
||||||
.auth { font-weight:bold; font-size:small; }
|
.auth { font-weight:bold; font-size:small; }
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
# vim:fileencoding=utf-8
|
||||||
'''
|
'''
|
||||||
https://www.world-archaeology.com
|
https://www.world-archaeology.com
|
||||||
'''
|
'''
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
# vim:fileencoding=utf-8
|
||||||
import json
|
import json
|
||||||
import time
|
import time
|
||||||
from datetime import datetime, timedelta
|
from datetime import datetime, timedelta
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
# vim:fileencoding=utf-8
|
||||||
import json
|
import json
|
||||||
import time
|
import time
|
||||||
from datetime import datetime, timedelta
|
from datetime import datetime, timedelta
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
# vim:fileencoding=utf-8
|
||||||
import json
|
import json
|
||||||
import time
|
import time
|
||||||
from datetime import datetime, timedelta
|
from datetime import datetime, timedelta
|
||||||
|
Loading…
x
Reference in New Issue
Block a user