mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
pep8
This commit is contained in:
parent
3537db5a8c
commit
d47fa7a629
@ -1,7 +1,8 @@
|
|||||||
from calibre.web.feeds.news import BasicNewsRecipe, classes
|
from calibre.web.feeds.news import BasicNewsRecipe, classes
|
||||||
from datetime import date, datetime, timedelta
|
from datetime import datetime, timedelta
|
||||||
from calibre.utils.date import parse_date
|
from calibre.utils.date import parse_date
|
||||||
|
|
||||||
|
|
||||||
class IndianExpress(BasicNewsRecipe):
|
class IndianExpress(BasicNewsRecipe):
|
||||||
title = u'Indian Express'
|
title = u'Indian Express'
|
||||||
language = 'en_IN'
|
language = 'en_IN'
|
||||||
@ -47,21 +48,21 @@ class IndianExpress(BasicNewsRecipe):
|
|||||||
section_list = [
|
section_list = [
|
||||||
('Front Page', 'https://indianexpress.com/print/front-page/'),
|
('Front Page', 'https://indianexpress.com/print/front-page/'),
|
||||||
('India', 'https://indianexpress.com/section/india/'),
|
('India', 'https://indianexpress.com/section/india/'),
|
||||||
#('Express Network', 'https://indianexpress.com/print/express-network/'),
|
# ('Express Network', 'https://indianexpress.com/print/express-network/'),
|
||||||
('Delhi Confidential', 'https://indianexpress.com/section/delhi-confidential/'),
|
('Delhi Confidential', 'https://indianexpress.com/section/delhi-confidential/'),
|
||||||
('Opinion', 'http://indianexpress.com/section/opinion/'),
|
('Opinion', 'http://indianexpress.com/section/opinion/'),
|
||||||
('UPSC-CSE Key', 'https://indianexpress.com/section/upsc-current-affairs/'),
|
('UPSC-CSE Key', 'https://indianexpress.com/section/upsc-current-affairs/'),
|
||||||
('Explained', 'https://indianexpress.com/section/explained/'),
|
('Explained', 'https://indianexpress.com/section/explained/'),
|
||||||
('Business', 'https://indianexpress.com/section/business/'),
|
('Business', 'https://indianexpress.com/section/business/'),
|
||||||
#('Political Pulse', 'https://indianexpress.com/section/political-pulse/'),
|
# ('Political Pulse', 'https://indianexpress.com/section/political-pulse/'),
|
||||||
('Sunday Eye', 'https://indianexpress.com/section/express-sunday-eye/'),
|
('Sunday Eye', 'https://indianexpress.com/section/express-sunday-eye/'),
|
||||||
('World', 'https://indianexpress.com/section/world/'),
|
('World', 'https://indianexpress.com/section/world/'),
|
||||||
#('Education', 'https://indianexpress.com/section/education/'),
|
# ('Education', 'https://indianexpress.com/section/education/'),
|
||||||
#('Gadgets', 'https://indianexpress.com/section/technology/gadgets/'),
|
# ('Gadgets', 'https://indianexpress.com/section/technology/gadgets/'),
|
||||||
('Tech Review', 'https://indianexpress.com/section/technology/tech-reviews/'),
|
('Tech Review', 'https://indianexpress.com/section/technology/tech-reviews/'),
|
||||||
#('Techhook', 'https://indianexpress.com/section/technology/techook/'),
|
# ('Techhook', 'https://indianexpress.com/section/technology/techook/'),
|
||||||
#('Laptops', 'https://indianexpress.com/section/technology/laptops/'),
|
# ('Laptops', 'https://indianexpress.com/section/technology/laptops/'),
|
||||||
#('Mobiles & Tabs', 'https://indianexpress.com/section/technology/mobile-tabs/'),
|
# ('Mobiles & Tabs', 'https://indianexpress.com/section/technology/mobile-tabs/'),
|
||||||
('Science', 'https://indianexpress.com/section/technology/science/'),
|
('Science', 'https://indianexpress.com/section/technology/science/'),
|
||||||
('Movie Review', 'https://indianexpress.com/section/entertainment/movie-review/'),
|
('Movie Review', 'https://indianexpress.com/section/entertainment/movie-review/'),
|
||||||
]
|
]
|
||||||
@ -86,7 +87,7 @@ class IndianExpress(BasicNewsRecipe):
|
|||||||
ans = []
|
ans = []
|
||||||
for div in soup.findAll(attrs={'class':['northeast-topbox', 'explained-section-grid']}):
|
for div in soup.findAll(attrs={'class':['northeast-topbox', 'explained-section-grid']}):
|
||||||
for a in div.findAll('a', href=True):
|
for a in div.findAll('a', href=True):
|
||||||
if not a.find('img') and not '/section/' in a['href']:
|
if not a.find('img') and '/section/' not in a['href']:
|
||||||
url = a['href']
|
url = a['href']
|
||||||
title = self.tag_to_string(a)
|
title = self.tag_to_string(a)
|
||||||
self.log('\t', title, '\n\t\t', url)
|
self.log('\t', title, '\n\t\t', url)
|
||||||
@ -98,7 +99,7 @@ class IndianExpress(BasicNewsRecipe):
|
|||||||
div = soup.find('div', attrs={'class':['nation', 'o-opin']})
|
div = soup.find('div', attrs={'class':['nation', 'o-opin']})
|
||||||
for art in div.findAll(attrs={'class':['articles', 'o-opin-article']}):
|
for art in div.findAll(attrs={'class':['articles', 'o-opin-article']}):
|
||||||
for a in art.findAll('a', href=True):
|
for a in art.findAll('a', href=True):
|
||||||
if not a.find('img') and not '/profile/' in a['href']:
|
if not a.find('img') and '/profile/' not in a['href']:
|
||||||
url = a['href']
|
url = a['href']
|
||||||
title = self.tag_to_string(a)
|
title = self.tag_to_string(a)
|
||||||
desc = ''
|
desc = ''
|
||||||
|
Loading…
x
Reference in New Issue
Block a user