mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-06-23 15:30:45 -04:00
...
This commit is contained in:
parent
a7cbe5c1b0
commit
6489fb251f
@ -10,8 +10,24 @@ class Politics(BasicNewsRecipe):
|
|||||||
use_embedded_content = False
|
use_embedded_content = False
|
||||||
|
|
||||||
no_stylesheets = True
|
no_stylesheets = True
|
||||||
|
no_javascript = True
|
||||||
auto_cleanup = True
|
auto_cleanup = True
|
||||||
|
|
||||||
feeds = [
|
def parse_index(self):
|
||||||
('General Knowledge Today', 'http://feeds.feedburner.com/GeneralKnowledgeToday'),
|
soup = self.index_to_soup('http://www.gktoday.in/')
|
||||||
]
|
|
||||||
|
# Find TOC
|
||||||
|
toc = soup.find('div', attrs={'class':'entry clearfix'})
|
||||||
|
articles = []
|
||||||
|
for li in toc.findAll('li'):
|
||||||
|
a = li.find('a')
|
||||||
|
info = self.tag_to_string(a)
|
||||||
|
url = a['href']
|
||||||
|
desc = ''
|
||||||
|
self.log('Found article:', info)
|
||||||
|
self.log('\t', url)
|
||||||
|
self.log('\t', desc)
|
||||||
|
articles.append({'title':info, 'url':url, 'date':'',
|
||||||
|
'description':desc})
|
||||||
|
|
||||||
|
return [('Current Issue', articles)]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user