| 1 |
import re |
| 2 |
|
| 3 |
from calibre.web.feeds.news import BasicNewsRecipe |
| 4 |
|
| 5 |
|
| 6 |
class AdvancedUserRecipe1283848012(BasicNewsRecipe): |
| 7 |
description = 'TheMarker Financial News in Hebrew' |
| 8 |
__author__ = 'Marbs' |
| 9 |
cover_url = 'http://static.ispot.co.il/wp-content/upload/2009/09/themarker.jpg' |
| 10 |
title = 'TheMarker' |
| 11 |
language = 'he' |
| 12 |
simultaneous_downloads = 5 |
| 13 |
remove_javascript = True |
| 14 |
timefmt = '[%a, %d %b, %Y]' |
| 15 |
oldest_article = 1 |
| 16 |
keep_only_tags = dict(name='div', attrs={'id': 'content'}) |
| 17 |
remove_attributes = ['width', 'float', 'margin-left'] |
| 18 |
no_stylesheets = True |
| 19 |
remove_tags = [ |
| 20 |
dict(name='div', attrs={'class': ['social-nav article-social-nav', 'prsnlArticleEnvelope', 'cb']}), |
| 21 |
dict(name='a', attrs={'href': ['/misc/mobile']}), |
| 22 |
dict(name='span', attrs={'class': ['post-summ']}), |
| 23 |
] |
| 24 |
max_articles_per_feed = 100 |
| 25 |
extra_css = 'body{direction: rtl;} .article_description{direction: rtl; } a.article{direction: rtl; } .calibre_feed_description{direction: rtl; }' |
| 26 |
feeds = [ |
| 27 |
('Head Lines', 'http://www.themarker.com/cmlink/1.144'), |
| 28 |
('TA Market', 'http://www.themarker.com/cmlink/1.243'), |
| 29 |
('Real Estate', 'http://www.themarker.com/cmlink/1.605656'), |
| 30 |
('Global', 'http://www.themarker.com/cmlink/1.605658'), |
| 31 |
('Wall Street', 'http://www.themarker.com/cmlink/1.613713'), |
| 32 |
('SmartPhone', 'http://www.themarker.com/cmlink/1.605661'), |
| 33 |
('Law', 'http://www.themarker.com/cmlink/1.605664'), |
| 34 |
('Media', 'http://www.themarker.com/cmlink/1.605660'), |
| 35 |
('Consumer', 'http://www.themarker.com/cmlink/1.605662'), |
| 36 |
('Career', 'http://www.themarker.com/cmlink/1.605665'), |
| 37 |
('Car', 'http://www.themarker.com/cmlink/1.605663'), |
| 38 |
('High Tech', 'http://www.themarker.com/cmlink/1.605659'), |
| 39 |
('Small Business', 'http://www.themarker.com/cmlink/1.605666'), |
| 40 |
] |
| 41 |
|
| 42 |
def print_version(self, url): |
| 43 |
# print_url='http://www.themarker.com/misc/article-print-page/'+split1[-1] |
| 44 |
txt = url |
| 45 |
|
| 46 |
re1 = '.*?' # Non-greedy match on filler |
| 47 |
re2 = '(tv)' # Word 1 |
| 48 |
|
| 49 |
rg = re.compile(re1 + re2, re.IGNORECASE | re.DOTALL) |
| 50 |
m = rg.search(txt) |
| 51 |
if m: |
| 52 |
# print('bad link') |
| 53 |
return 1 |