mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 18:24:30 -04:00
...
This commit is contained in:
parent
9a21c6e8ad
commit
a7b652e8ff
@ -1,30 +0,0 @@
|
|||||||
from calibre.web.feeds.news import BasicNewsRecipe
|
|
||||||
from calibre.ebooks.BeautifulSoup import BeautifulSoup
|
|
||||||
|
|
||||||
class LongForm(BasicNewsRecipe):
|
|
||||||
title = u'Longform.org'
|
|
||||||
language = 'en'
|
|
||||||
description = '''
|
|
||||||
Longform.org posts new and classic non-fiction articles, curated from across
|
|
||||||
the web, that are too long and too interesting to be read on a web browser.
|
|
||||||
'''
|
|
||||||
__author__ = 'David Blackman'
|
|
||||||
oldest_article = 7 #days
|
|
||||||
max_articles_per_feed = 25
|
|
||||||
no_stylesheets = True
|
|
||||||
|
|
||||||
cover_url = 'http://longform.org/wp-content/themes/grid_focus/images/longform_flag.jpg'
|
|
||||||
|
|
||||||
feeds = [(u'All', u'http://longform.org/feed/')]
|
|
||||||
|
|
||||||
def get_article_url(self, article):
|
|
||||||
url = article.get('link')
|
|
||||||
raw = self.browser.open(url).read()
|
|
||||||
soup = BeautifulSoup(raw.decode('utf8', 'replace'))
|
|
||||||
|
|
||||||
# this might be more reliable: <a href="http://www.addtoany.com/add_to/tumblr?linkurl=http://english.aljazeera.net/indepth/opinion/2011/02/20112101030726228.html&linkname=WhyEgypt’s Progressives Win%20%5Bvia%20Longform.org%5D" target="blank"><img src="http://longform.org/wp-content/themes/grid_focus/images/tumblr.png" border="0px">Tumblr</a>
|
|
||||||
|
|
||||||
share_links = soup.findAll('a', {'class': 'twitter-share-button'})
|
|
||||||
if (len(share_links)):
|
|
||||||
return share_links[-1].get('data-url')
|
|
||||||
return None
|
|
Loading…
x
Reference in New Issue
Block a user