mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
New recipe for The Escapist by Lorenzo Vigentini
This commit is contained in:
parent
3ced1df5e8
commit
7a2e4a43e6
@ -1,5 +1,4 @@
|
|||||||
from calibre.web.feeds.news import BasicNewsRecipe
|
from calibre.web.feeds.news import BasicNewsRecipe
|
||||||
from calibre.ebooks.BeautifulSoup import BeautifulSoup
|
|
||||||
import re
|
import re
|
||||||
|
|
||||||
class NatureNews(BasicNewsRecipe):
|
class NatureNews(BasicNewsRecipe):
|
||||||
@ -30,15 +29,3 @@ class NatureNews(BasicNewsRecipe):
|
|||||||
def get_article_url(self, article):
|
def get_article_url(self, article):
|
||||||
return article.get('id')
|
return article.get('id')
|
||||||
|
|
||||||
#def preprocess_html(self, soup):
|
|
||||||
#story = soup.find(name='div', attrs={'id':'contentColumn'})
|
|
||||||
#td = heading.findParent(name='td')
|
|
||||||
#td.extract()
|
|
||||||
#soup = BeautifulSoup('<html><head><title>t</title></head><body></body></html>')
|
|
||||||
#body = soup.find(name='body')
|
|
||||||
#body.insert(0, story)
|
|
||||||
#for x in soup.findAll(name='p', text=lambda x:x and '-->' in x):
|
|
||||||
#p = x.findParent('p')
|
|
||||||
#if p is not None:
|
|
||||||
#p.extract()
|
|
||||||
#return soup
|
|
||||||
|
@ -1,7 +1,4 @@
|
|||||||
import string, re
|
|
||||||
from calibre import strftime
|
|
||||||
from calibre.web.feeds.recipes import BasicNewsRecipe
|
from calibre.web.feeds.recipes import BasicNewsRecipe
|
||||||
from calibre.ebooks.BeautifulSoup import BeautifulSoup
|
|
||||||
|
|
||||||
class NewZealandHerald(BasicNewsRecipe):
|
class NewZealandHerald(BasicNewsRecipe):
|
||||||
|
|
||||||
|
59
resources/recipes/the_escapist.recipe
Normal file
59
resources/recipes/the_escapist.recipe
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
__license__ = 'GPL v3'
|
||||||
|
__author__ = 'Lorenzo Vigentini'
|
||||||
|
__copyright__ = '2009, Lorenzo Vigentini <l.vigentini at gmail.com>'
|
||||||
|
description = 'the Escapist Magazine - v1.02 (09, January 2010)'
|
||||||
|
|
||||||
|
'''
|
||||||
|
http://www.escapistmagazine.com/
|
||||||
|
'''
|
||||||
|
|
||||||
|
from calibre.web.feeds.news import BasicNewsRecipe
|
||||||
|
|
||||||
|
class al(BasicNewsRecipe):
|
||||||
|
author = 'Lorenzo Vigentini'
|
||||||
|
description = 'the Escapist Magazine'
|
||||||
|
|
||||||
|
cover_url = 'http://cdn.themis-media.com/themes/escapistmagazine/default/images/logo.png'
|
||||||
|
title = u'the Escapist Magazine'
|
||||||
|
publisher = 'Themis media'
|
||||||
|
category = 'Video games news, lifestyle, gaming culture'
|
||||||
|
|
||||||
|
language = 'en'
|
||||||
|
timefmt = '[%a, %d %b, %Y]'
|
||||||
|
|
||||||
|
oldest_article = 1
|
||||||
|
max_articles_per_feed = 100
|
||||||
|
use_embedded_content = False
|
||||||
|
recursion = 10
|
||||||
|
|
||||||
|
remove_javascript = True
|
||||||
|
no_stylesheets = True
|
||||||
|
|
||||||
|
feeds = [
|
||||||
|
(u'Daily News', u'http://www.escapistmagazine.com/rss/news/0.xml'),
|
||||||
|
(u'Articles', u'http://www.escapistmagazine.com/rss/articles/0.xml')
|
||||||
|
]
|
||||||
|
|
||||||
|
def print_version(self,url):
|
||||||
|
baseURL='http://www.escapistmagazine.com'
|
||||||
|
segments = url.split('/')
|
||||||
|
#basename = '/'.join(segments[:3]) + '/'
|
||||||
|
subPath= '/'+ segments[3] + '/'
|
||||||
|
articleURL=(segments[len(segments)-1])[0:5]
|
||||||
|
|
||||||
|
if articleURL[4] =='-':
|
||||||
|
articleURL=articleURL[:4]
|
||||||
|
|
||||||
|
printVerString='print/'+ articleURL
|
||||||
|
s= baseURL + subPath + printVerString
|
||||||
|
return s
|
||||||
|
|
||||||
|
keep_only_tags = [
|
||||||
|
dict(name='div', attrs={'id':'article'})
|
||||||
|
]
|
||||||
|
|
||||||
|
remove_tags = [
|
||||||
|
dict(name='div',attrs={'id':['ad_leaderboard','print_notice','bottom_panel_container']})
|
||||||
|
]
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user