mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Update The Escapist
This commit is contained in:
parent
83c306de07
commit
e462981f24
@ -1,8 +1,11 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
__license__ = 'GPL v3'
|
__license__ = 'GPL v3'
|
||||||
__author__ = 'Lorenzo Vigentini'
|
__author__ = 'Lorenzo Vigentini and Tom Surace'
|
||||||
__copyright__ = '2009, Lorenzo Vigentini <l.vigentini at gmail.com>'
|
__copyright__ = '2009, Lorenzo Vigentini <l.vigentini at gmail.com>, 2013 Tom Surace <tekhedd@byteheaven.net>'
|
||||||
description = 'the Escapist Magazine - v1.02 (09, January 2010)'
|
description = 'The Escapist Magazine - v1.3 (2013, April 2013)'
|
||||||
|
|
||||||
|
#
|
||||||
|
# Based on 'the Escapist Magazine - v1.02 (09, January 2010)'
|
||||||
|
|
||||||
'''
|
'''
|
||||||
http://www.escapistmagazine.com/
|
http://www.escapistmagazine.com/
|
||||||
@ -11,12 +14,11 @@ http://www.escapistmagazine.com/
|
|||||||
from calibre.web.feeds.news import BasicNewsRecipe
|
from calibre.web.feeds.news import BasicNewsRecipe
|
||||||
|
|
||||||
class al(BasicNewsRecipe):
|
class al(BasicNewsRecipe):
|
||||||
author = 'Lorenzo Vigentini'
|
author = 'Lorenzo Vigentini and Tom Surace'
|
||||||
description = 'The Escapist Magazine'
|
description = 'The Escapist Magazine'
|
||||||
|
|
||||||
cover_url = 'http://cdn.themis-media.com/themes/escapistmagazine/default/images/logo.png'
|
cover_url = 'http://cdn.themis-media.com/themes/escapistmagazine/default/images/logo.png'
|
||||||
title = u'The Escapist Magazine'
|
title = u'The Escapist Magazine'
|
||||||
publisher = 'Themis media'
|
publisher = 'Themis Media'
|
||||||
category = 'Video games news, lifestyle, gaming culture'
|
category = 'Video games news, lifestyle, gaming culture'
|
||||||
|
|
||||||
language = 'en'
|
language = 'en'
|
||||||
@ -36,18 +38,19 @@ class al(BasicNewsRecipe):
|
|||||||
]
|
]
|
||||||
|
|
||||||
def print_version(self,url):
|
def print_version(self,url):
|
||||||
|
# Expect article url in the format:
|
||||||
|
# http://www.escapistmagazine.com/news/view/123198-article-name?utm_source=rss&utm_medium=rss&utm_campaign=news
|
||||||
|
#
|
||||||
baseURL='http://www.escapistmagazine.com'
|
baseURL='http://www.escapistmagazine.com'
|
||||||
segments = url.split('/')
|
segments = url.split('/')
|
||||||
#basename = '/'.join(segments[:3]) + '/'
|
|
||||||
subPath= '/'+ segments[3] + '/'
|
subPath= '/'+ segments[3] + '/'
|
||||||
articleURL=(segments[len(segments)-1])[0:5]
|
|
||||||
|
|
||||||
if articleURL[4] =='-':
|
# The article number is the "number" that starts the name
|
||||||
articleURL=articleURL[:4]
|
articleNumber = segments[len(segments)-1]; # the "article name"
|
||||||
|
articleNumber = articleNumber.split('-')[0]; # keep part before hyphen
|
||||||
|
|
||||||
printVerString='print/'+ articleURL
|
fullUrl = baseURL + subPath + 'print/' + articleNumber
|
||||||
s= baseURL + subPath + printVerString
|
return fullUrl
|
||||||
return s
|
|
||||||
|
|
||||||
keep_only_tags = [
|
keep_only_tags = [
|
||||||
dict(name='div', attrs={'id':'article'})
|
dict(name='div', attrs={'id':'article'})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user