mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-09-29 15:31:08 -04:00
34 lines
976 B
Plaintext
34 lines
976 B
Plaintext
from calibre.web.feeds.news import BasicNewsRecipe
|
|
|
|
|
|
class Politics(BasicNewsRecipe):
|
|
title = u'General Knowledge Today'
|
|
language = 'en_IN'
|
|
__author__ = 'Kanika G'
|
|
oldest_article = 7 # days
|
|
max_articles_per_feed = 20
|
|
use_embedded_content = False
|
|
|
|
no_stylesheets = True
|
|
no_javascript = True
|
|
auto_cleanup = True
|
|
|
|
def parse_index(self):
|
|
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)]
|