mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
IGN:...
This commit is contained in:
parent
21b8b2a68a
commit
327158b634
@ -1,43 +1,43 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
|
|
||||||
__license__ = 'GPL v3'
|
__license__ = 'GPL v3'
|
||||||
__copyright__ = '2009, Darko Miletic <darko.miletic at gmail.com>'
|
__copyright__ = '2009, Darko Miletic <darko.miletic at gmail.com>'
|
||||||
'''
|
'''
|
||||||
msdn.microsoft.com/en-us/magazine
|
msdn.microsoft.com/en-us/magazine
|
||||||
'''
|
'''
|
||||||
from calibre.web.feeds.news import BasicNewsRecipe
|
from calibre.web.feeds.news import BasicNewsRecipe
|
||||||
|
|
||||||
class MSDNMagazine_en(BasicNewsRecipe):
|
class MSDNMagazine_en(BasicNewsRecipe):
|
||||||
title = 'MSDN Magazine'
|
title = 'MSDN Magazine'
|
||||||
__author__ = 'Darko Miletic'
|
__author__ = 'Darko Miletic'
|
||||||
description = 'The Microsoft Journal for Developers'
|
description = 'The Microsoft Journal for Developers'
|
||||||
publisher = 'Microsoft Press'
|
publisher = 'Microsoft Press'
|
||||||
category = 'news, IT, Microsoft, programming, windows'
|
category = 'news, IT, Microsoft, programming, windows'
|
||||||
oldest_article = 31
|
oldest_article = 31
|
||||||
max_articles_per_feed = 100
|
max_articles_per_feed = 100
|
||||||
no_stylesheets = True
|
no_stylesheets = True
|
||||||
use_embedded_content = False
|
use_embedded_content = False
|
||||||
encoding = 'utf-8'
|
encoding = 'utf-8'
|
||||||
language = 'en'
|
language = 'en'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
feeds = [(u'Articles', u'http://msdn.microsoft.com/en-us/magazine/rss/default.aspx?z=z&iss=1')]
|
feeds = [(u'Articles', u'http://msdn.microsoft.com/en-us/magazine/rss/default.aspx?z=z&iss=1')]
|
||||||
|
|
||||||
keep_only_tags = [dict(name='div', attrs={'class':'navpage'})]
|
keep_only_tags = [dict(name='div', attrs={'class':'navpage'})]
|
||||||
|
|
||||||
remove_tags = [
|
remove_tags = [
|
||||||
dict(name=['object','link','base','table'])
|
dict(name=['object','link','base','table'])
|
||||||
,dict(name='div', attrs={'class':'MTPS_CollapsibleRegion'})
|
,dict(name='div', attrs={'class':'MTPS_CollapsibleRegion'})
|
||||||
]
|
]
|
||||||
remove_tags_after = dict(name='div', attrs={'class':'navpage'})
|
remove_tags_after = dict(name='div', attrs={'class':'navpage'})
|
||||||
|
|
||||||
def preprocess_html(self, soup):
|
def preprocess_html(self, soup):
|
||||||
for item in soup.findAll('div',attrs={'class':['FeatureSmallHead','ColumnTypeSubTitle']}):
|
for item in soup.findAll('div',attrs={'class':['FeatureSmallHead','ColumnTypeSubTitle']}):
|
||||||
item.name="h2"
|
item.name="h2"
|
||||||
for item in soup.findAll('div',attrs={'class':['FeatureHeadline','ColumnTypeTitle']}):
|
for item in soup.findAll('div',attrs={'class':['FeatureHeadline','ColumnTypeTitle']}):
|
||||||
item.name="h1"
|
item.name="h1"
|
||||||
for item in soup.findAll('div',attrs={'class':'ArticleTypeTitle'}):
|
for item in soup.findAll('div',attrs={'class':'ArticleTypeTitle'}):
|
||||||
item.name="h3"
|
item.name="h3"
|
||||||
return soup
|
return soup
|
||||||
|
|
||||||
|
@ -1,50 +1,50 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
|
|
||||||
__license__ = 'GPL v3'
|
__license__ = 'GPL v3'
|
||||||
__copyright__ = '2009, Darko Miletic <darko.miletic at gmail.com>'
|
__copyright__ = '2009, Darko Miletic <darko.miletic at gmail.com>'
|
||||||
'''
|
'''
|
||||||
www.straitstimes.com
|
www.straitstimes.com
|
||||||
'''
|
'''
|
||||||
|
|
||||||
from calibre.web.feeds.recipes import BasicNewsRecipe
|
from calibre.web.feeds.recipes import BasicNewsRecipe
|
||||||
|
|
||||||
class StraitsTimes(BasicNewsRecipe):
|
class StraitsTimes(BasicNewsRecipe):
|
||||||
title = 'The Straits Times'
|
title = 'The Straits Times'
|
||||||
__author__ = 'Darko Miletic'
|
__author__ = 'Darko Miletic'
|
||||||
description = 'Singapore newspaper'
|
description = 'Singapore newspaper'
|
||||||
oldest_article = 2
|
oldest_article = 2
|
||||||
max_articles_per_feed = 100
|
max_articles_per_feed = 100
|
||||||
no_stylesheets = True
|
no_stylesheets = True
|
||||||
use_embedded_content = False
|
use_embedded_content = False
|
||||||
encoding = 'cp1252'
|
encoding = 'cp1252'
|
||||||
publisher = 'Singapore Press Holdings Ltd.'
|
publisher = 'Singapore Press Holdings Ltd.'
|
||||||
category = 'news, politics, singapore, asia'
|
category = 'news, politics, singapore, asia'
|
||||||
language = 'en'
|
language = 'en'
|
||||||
extra_css = ' .top_headline{font-size: x-large; font-weight: bold} '
|
extra_css = ' .top_headline{font-size: x-large; font-weight: bold} '
|
||||||
|
|
||||||
conversion_options = {
|
conversion_options = {
|
||||||
'comments' : description
|
'comments' : description
|
||||||
,'tags' : category
|
,'tags' : category
|
||||||
,'language' : language
|
,'language' : language
|
||||||
,'publisher' : publisher
|
,'publisher' : publisher
|
||||||
}
|
}
|
||||||
|
|
||||||
remove_tags = [dict(name=['object','link','map'])]
|
remove_tags = [dict(name=['object','link','map'])]
|
||||||
|
|
||||||
keep_only_tags = [dict(name='div', attrs={'class':['top_headline','story_text']})]
|
keep_only_tags = [dict(name='div', attrs={'class':['top_headline','story_text']})]
|
||||||
|
|
||||||
feeds = [
|
feeds = [
|
||||||
(u'Singapore' , u'http://www.straitstimes.com/STI/STIFILES/rss/break_singapore.xml' )
|
(u'Singapore' , u'http://www.straitstimes.com/STI/STIFILES/rss/break_singapore.xml' )
|
||||||
,(u'SE Asia' , u'http://www.straitstimes.com/STI/STIFILES/rss/break_sea.xml' )
|
,(u'SE Asia' , u'http://www.straitstimes.com/STI/STIFILES/rss/break_sea.xml' )
|
||||||
,(u'Money' , u'http://www.straitstimes.com/STI/STIFILES/rss/break_money.xml' )
|
,(u'Money' , u'http://www.straitstimes.com/STI/STIFILES/rss/break_money.xml' )
|
||||||
,(u'Sport' , u'http://www.straitstimes.com/STI/STIFILES/rss/break_sport.xml' )
|
,(u'Sport' , u'http://www.straitstimes.com/STI/STIFILES/rss/break_sport.xml' )
|
||||||
,(u'World' , u'http://www.straitstimes.com/STI/STIFILES/rss/break_world.xml' )
|
,(u'World' , u'http://www.straitstimes.com/STI/STIFILES/rss/break_world.xml' )
|
||||||
,(u'Tech & Science' , u'http://www.straitstimes.com/STI/STIFILES/rss/break_tech.xml' )
|
,(u'Tech & Science' , u'http://www.straitstimes.com/STI/STIFILES/rss/break_tech.xml' )
|
||||||
,(u'Lifestyle' , u'http://www.straitstimes.com/STI/STIFILES/rss/break_lifestyle.xml' )
|
,(u'Lifestyle' , u'http://www.straitstimes.com/STI/STIFILES/rss/break_lifestyle.xml' )
|
||||||
]
|
]
|
||||||
|
|
||||||
def preprocess_html(self, soup):
|
def preprocess_html(self, soup):
|
||||||
for item in soup.findAll(style=True):
|
for item in soup.findAll(style=True):
|
||||||
del item['style']
|
del item['style']
|
||||||
return soup
|
return soup
|
||||||
|
|
||||||
|
@ -1,49 +1,49 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
|
|
||||||
__license__ = 'GPL v3'
|
__license__ = 'GPL v3'
|
||||||
__copyright__ = '2009, Darko Miletic <darko.miletic at gmail.com>'
|
__copyright__ = '2009, Darko Miletic <darko.miletic at gmail.com>'
|
||||||
'''
|
'''
|
||||||
www.thestar.com
|
www.thestar.com
|
||||||
'''
|
'''
|
||||||
|
|
||||||
from calibre.web.feeds.news import BasicNewsRecipe
|
from calibre.web.feeds.news import BasicNewsRecipe
|
||||||
|
|
||||||
class TheTorontoStar(BasicNewsRecipe):
|
class TheTorontoStar(BasicNewsRecipe):
|
||||||
title = 'The Toronto Star'
|
title = 'The Toronto Star'
|
||||||
__author__ = 'Darko Miletic'
|
__author__ = 'Darko Miletic'
|
||||||
description = "Canada's largest daily newspaper"
|
description = "Canada's largest daily newspaper"
|
||||||
oldest_article = 2
|
oldest_article = 2
|
||||||
language = 'en_CA'
|
language = 'en_CA'
|
||||||
max_articles_per_feed = 100
|
max_articles_per_feed = 100
|
||||||
no_stylesheets = True
|
no_stylesheets = True
|
||||||
use_embedded_content = False
|
use_embedded_content = False
|
||||||
delay = 2
|
delay = 2
|
||||||
publisher = 'The Toronto Star'
|
publisher = 'The Toronto Star'
|
||||||
category = "Toronto Star,Canada's largest daily newspaper,breaking news,classifieds,careers,GTA,Toronto Maple Leafs,sports,Toronto,news,editorial,The Star,Ontario,information,columnists,business,entertainment,births,deaths,automotive,rentals,weather,archives,Torstar,technology,Joseph Atkinson"
|
category = "Toronto Star,Canada's largest daily newspaper,breaking news,classifieds,careers,GTA,Toronto Maple Leafs,sports,Toronto,news,editorial,The Star,Ontario,information,columnists,business,entertainment,births,deaths,automotive,rentals,weather,archives,Torstar,technology,Joseph Atkinson"
|
||||||
encoding = 'utf-8'
|
encoding = 'utf-8'
|
||||||
|
|
||||||
conversion_options = {
|
conversion_options = {
|
||||||
'comments' : description
|
'comments' : description
|
||||||
,'tags' : category
|
,'tags' : category
|
||||||
,'publisher' : publisher
|
,'publisher' : publisher
|
||||||
}
|
}
|
||||||
|
|
||||||
keep_only_tags = [dict(name='div', attrs={'class':'ts-article'})]
|
keep_only_tags = [dict(name='div', attrs={'class':'ts-article'})]
|
||||||
remove_tags_before = dict(name='div',attrs={'id':'ts-article_header'})
|
remove_tags_before = dict(name='div',attrs={'id':'ts-article_header'})
|
||||||
|
|
||||||
feeds = [
|
feeds = [
|
||||||
(u'News' , u'http://www.thestar.com/rss/0?searchMode=Query&categories=296' )
|
(u'News' , u'http://www.thestar.com/rss/0?searchMode=Query&categories=296' )
|
||||||
,(u'Opinions' , u'http://www.thestar.com/rss/0?searchMode=Query&categories=311' )
|
,(u'Opinions' , u'http://www.thestar.com/rss/0?searchMode=Query&categories=311' )
|
||||||
,(u'Business' , u'http://www.thestar.com/rss/0?searchMode=Query&categories=294' )
|
,(u'Business' , u'http://www.thestar.com/rss/0?searchMode=Query&categories=294' )
|
||||||
,(u'Sports' , u'http://www.thestar.com/rss/0?searchMode=Query&categories=295' )
|
,(u'Sports' , u'http://www.thestar.com/rss/0?searchMode=Query&categories=295' )
|
||||||
,(u'Entertainment', u'http://www.thestar.com/rss/0?searchMode=Query&categories=296' )
|
,(u'Entertainment', u'http://www.thestar.com/rss/0?searchMode=Query&categories=296' )
|
||||||
,(u'Living' , u'http://www.thestar.com/rss/0?searchMode=Query&categories=296' )
|
,(u'Living' , u'http://www.thestar.com/rss/0?searchMode=Query&categories=296' )
|
||||||
,(u'Travel' , u'http://www.thestar.com/rss/82858?searchMode=Lineup' )
|
,(u'Travel' , u'http://www.thestar.com/rss/82858?searchMode=Lineup' )
|
||||||
,(u'Science' , u'http://www.thestar.com/rss/82848?searchMode=Query&categories=300')
|
,(u'Science' , u'http://www.thestar.com/rss/82848?searchMode=Query&categories=300')
|
||||||
]
|
]
|
||||||
|
|
||||||
def print_version(self, url):
|
def print_version(self, url):
|
||||||
artl = url.rpartition('--')[0]
|
artl = url.rpartition('--')[0]
|
||||||
artid = artl.rpartition('/')[2]
|
artid = artl.rpartition('/')[2]
|
||||||
return 'http://www.thestar.com/printarticle/' + artid
|
return 'http://www.thestar.com/printarticle/' + artid
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user