Arts and Letters Daily by pjpaulpj

Merge branch 'patch-1' of https://github.com/pjpaulpj/calibre
This commit is contained in:
Kovid Goyal 2018-11-05 16:26:31 +05:30
commit bd1db700fe
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

37
recipes/ald.recipe Normal file
View File

@ -0,0 +1,37 @@
#!/usr/bin/env python2
from __future__ import unicode_literals, division, absolute_import, print_function
__license__ = 'GPL v3'
__copyright__ = '2018, PJ Paul '
'''
Recipe for Arts and Letters Daily website https://www.aldaily.com/
'''
from calibre.web.feeds.news import BasicNewsRecipe
class ALD(BasicNewsRecipe):
title = 'Arts and Letters Daily'
oldest_article = 7
max_articles_per_feed = 100
auto_cleanup = True
recursions = 0
ignore_duplicate_articles = {'url'}
index = 'https://www.aldaily.com/alt/'
cover_url = 'https://www.aldaily.com/static/images/header.gif'
__author__ = 'https://github.com/pjpaulpj'
language = 'en'
encoding = 'utf-8'
def parse_index(self):
articles = []
feeds = []
soup = self.index_to_soup(self.index)
for x in soup.findAll('p'):
if x.find('a'):
title = self.tag_to_string(x)
url = x.find('a')['href']
articles.append({'title':title, 'url':url, 'description': '', 'date':''})
feeds.append(('Articles', articles))
return feeds