mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
The West Australian by Darko Miletic
This commit is contained in:
parent
a4ff200488
commit
e04d61fe17
BIN
resources/images/news/thewest_au.png
Normal file
BIN
resources/images/news/thewest_au.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 748 B |
63
resources/recipes/thewest_au.recipe
Normal file
63
resources/recipes/thewest_au.recipe
Normal file
@ -0,0 +1,63 @@
|
||||
__license__ = 'GPL v3'
|
||||
__copyright__ = '2010, Darko Miletic <darko.miletic at gmail.com>'
|
||||
'''
|
||||
thewest.com.au
|
||||
'''
|
||||
|
||||
import re
|
||||
from calibre.web.feeds.news import BasicNewsRecipe
|
||||
|
||||
class TheWest(BasicNewsRecipe):
|
||||
title = 'The West Australian'
|
||||
__author__ = 'Darko Miletic'
|
||||
description = 'News from Australia'
|
||||
publisher = 'thewest.com.au'
|
||||
category = 'news, politics, Australia'
|
||||
oldest_article = 2
|
||||
max_articles_per_feed = 200
|
||||
no_stylesheets = True
|
||||
encoding = 'utf8'
|
||||
use_embedded_content = False
|
||||
language = 'en_AU'
|
||||
remove_empty_feeds = True
|
||||
publication_type = 'newspaper'
|
||||
masthead_url = 'http://l.yimg.com/ao/i/mp/properties/news/02/wan/img/wan-logo-h49.png'
|
||||
extra_css = ' .article{font-family: Arial,Helvetica,sans-serif } .image{font-size: x-small} '
|
||||
|
||||
preprocess_regexps = [
|
||||
(re.compile(r'</title>.*?</head>', re.DOTALL|re.IGNORECASE),lambda match: '</title></head>')
|
||||
]
|
||||
|
||||
conversion_options = {
|
||||
'comment' : description
|
||||
, 'tags' : category
|
||||
, 'publisher' : publisher
|
||||
, 'language' : language
|
||||
}
|
||||
|
||||
remove_tags = [
|
||||
dict(attrs={'class':['tools','lhs']})
|
||||
,dict(attrs={'id' :'tools-bottom'})
|
||||
,dict(attrs={'href' :'http://twitter.com/thewest_com_au'})
|
||||
]
|
||||
keep_only_tags = [dict(attrs={'class':'mod article'})]
|
||||
remove_attributes = ['width','height']
|
||||
|
||||
|
||||
feeds = [
|
||||
(u'WA News' , u'http://d.yimg.com/au.rss.news.yahoo.com/thewest/wa.xml' )
|
||||
,(u'National' , u'http://d.yimg.com/au.rss.news.yahoo.com/thewest/national.xml' )
|
||||
,(u'World' , u'http://d.yimg.com/au.rss.news.yahoo.com/thewest/world.xml' )
|
||||
,(u'Offbeat' , u'http://d.yimg.com/au.rss.news.yahoo.com/thewest/offbeat.xml' )
|
||||
,(u'Business' , u'http://d.yimg.com/au.rss.news.yahoo.com/thewest/business.xml' )
|
||||
,(u'Sport' , u'http://d.yimg.com/au.rss.news.yahoo.com/thewest/sport.xml' )
|
||||
,(u'Entertainment' , u'http://d.yimg.com/au.rss.news.yahoo.com/thewest/entertainment.xml' )
|
||||
,(u'Travel' , u'http://d.yimg.com/au.rss.news.yahoo.com/thewest/travel.xml' )
|
||||
,(u'Life+Style' , u'http://d.yimg.com/au.rss.news.yahoo.com/thewest/lifestyle.xml' )
|
||||
]
|
||||
|
||||
def get_article_url(self, article):
|
||||
return article.get('guid', None)
|
||||
|
||||
def preprocess_html(self, soup):
|
||||
return self.adeify_images(soup)
|
@ -14,7 +14,7 @@
|
||||
<string>Schedule news download</string>
|
||||
</property>
|
||||
<property name="windowIcon">
|
||||
<iconset resource="../../../../resources/images.qrc">
|
||||
<iconset>
|
||||
<normaloff>:/images/scheduler.svg</normaloff>:/images/scheduler.svg</iconset>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
@ -79,7 +79,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>375</width>
|
||||
<height>500</height>
|
||||
<height>502</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_5">
|
||||
@ -371,7 +371,7 @@
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Ok</set>
|
||||
<set>QDialogButtonBox::Save</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
Loading…
x
Reference in New Issue
Block a user