Debian Codegraph @

recipes/ynet.recipe

raw
1 import re
2
3 from calibre.web.feeds.news import BasicNewsRecipe
4
5
6 class AdvancedUserRecipe1283848012(BasicNewsRecipe):
7 description = 'This is a recipe of Ynet.co.il.'
8 cover_url = 'http://www.ynet.co.il/images/CENTRAL_logo.gif'
9 title = 'Ynet'
10 __author__ = 'marbs & barakplasma'
11 language = 'he'
12 extra_css = 'img {max-width:100%;direction: rtl;} #article{direction: rtl;} div{direction: rtl;} title{direction: rtl; } article_description{direction: rtl; } a.article{direction: rtl; } calibre_feed_description{direction: rtl; } body{direction: ltr;}' # noqa: E501
13 remove_attributes = ['width']
14 simultaneous_downloads = 5
15 keep_only_tags = [
16 dict(name='h1', attrs={'class': 'mainTitle'}),
17 dict(name='h2', attrs={'class': 'subTitle'}),
18 dict(name='div', attrs={'class': 'text_editor_paragraph rtl'}),
19 dict(name='div', attrs={'class': 'ArticleBodyComponent'}),
20 ]
21 remove_javascript = True
22 timefmt = '[%a, %d %b, %Y]'
23 oldest_article = 1
24 remove_tags = [dict(name='p', attrs={'text': [' ']})]
25 max_articles_per_feed = 100
26 preprocess_regexps = [(re.compile(r'<p>&nbsp;</p>', re.DOTALL | re.IGNORECASE), lambda match: '')]
27
28 def preprocess_html(self, soup):
29 soup.html['dir'] = 'rtl'
30 soup.body['dir'] = 'rtl'
31 return soup
32
33 feeds = [
34 ('כל ערוץ החדשות', 'http://www.ynet.co.il/Integration/StoryRss2.xml'),
35 ('מבזקי החדשות', 'http://www.ynet.co.il/Integration/StoryRss1854.xml'),
36 ('בלוגוס', 'http://www.ynet.co.il/Integration/StoryRss3764.xml'),
37 ('כל ערוץ הדעות', 'http://www.ynet.co.il/Integration/StoryRss194.xml'),
38 ('יומני סבר', 'http://www.ynet.co.il/Integration/StoryRss3487.xml'),
39 ('כל ערוץ הצרכנות', 'http://www.ynet.co.il/Integration/StoryRss5363.xml'),
40 ('כל ערוץ הספורט', 'http://www.ynet.co.il/Integration/StoryRss3.xml'),
41 ('כדורגל ישראלי', 'http://www.ynet.co.il/Integration/StoryRss57.xml'),
42 ('כל ערוץ התרבות', 'http://www.ynet.co.il/Integration/StoryRss538.xml'),
43 ('בלוג הפרעות', 'http://www.ynet.co.il/Integration/StoryRss4450.xml'),
44 ('חיים בסרט', 'http://www.ynet.co.il/Integration/StoryRss3908.xml'),
45 ('כל ערוץ מעורבות', 'http://www.ynet.co.il/Integration/StoryRss3262.xml'),
46 ('בית', 'http://www.ynet.co.il/Integration/StoryRss4113.xml'),
47 ('זוגיות', 'http://www.ynet.co.il/Integration/StoryRss4107.xml'),
48 ('מלחשים', 'http://www.ynet.co.il/Integration/StoryRss4105.xml'),
49 ('סטייל', 'http://www.ynet.co.il/Integration/StoryRss4104.xml'),
50 ('קריירה', 'http://www.ynet.co.il/Integration/StoryRss4111.xml'),
51 ('שף', 'http://www.ynet.co.il/Integration/StoryRss4335.xml'),
52 ('כל ערוץ הבריאות', 'http://www.ynet.co.il/Integration/StoryRss1208.xml'),
53 ('כל הערוץ הירוק', 'http://www.ynet.co.il/Integration/StoryRss4872.xml'),
54 ('סביבה', 'http://www.ynet.co.il/Integration/StoryRss4879.xml'),
55 ('בעלי חיים', 'http://www.ynet.co.il/Integration/StoryRss4880.xml'),
56 ('שאלות חיות', 'http://www.ynet.co.il/Integration/StoryRss4926.xml'),
57 ('כל ערוץ המחשבים', 'http://www.ynet.co.il/Integration/StoryRss544.xml'),
58 ('סקירות', 'http://www.ynet.co.il/Integration/StoryRss2424.xml'),
59 ('אינטרנט', 'http://www.ynet.co.il/Integration/StoryRss546.xml'),
60 ('משחקים', 'http://www.ynet.co.il/Integration/StoryRss571.xml'),
61 ('PC מגזין', 'http://www.ynet.co.il/Integration/StoryRss1694.xml'),
62 ('טכנולוגיה', 'http://www.ynet.co.il/Integration/StoryRss545.xml'),
63 ('קטעי קישור', 'http://www.ynet.co.il/Integration/StoryRss4540.xml'),
64 ('מרושתים', 'http://www.ynet.co.il/Integration/StoryRss4541.xml'),
65 ('מדריכים ותוכנה', 'http://www.ynet.co.il/Integration/StoryRss786.xml'),
66 ('כל ערוץ הרכב', 'http://www.ynet.co.il/Integration/StoryRss550.xml'),
67 ('כל ערוץ התיירות', 'http://www.ynet.co.il/Integration/StoryRss598.xml'),
68 ('כל ערוץ ההורים', 'http://www.ynet.co.il/Integration/StoryRss3052.xml'),
69 ('כל ערוץ האוכל', 'http://www.ynet.co.il/Integration/StoryRss975.xml'),
70 ('כל ערוץ היהדות', 'http://www.ynet.co.il/Integration/StoryRss4403.xml'),
71 ('במנהרת הזמן', 'http://www.ynet.co.il/Integration/StoryRss4542.xml'),
72 ('כל ערוץ הכלכלה', 'http://www.ynet.co.il/Integration/StoryRss6.xml'),
73 ('כל ערוץ מדע וטבע', 'http://www.ynet.co.il/Integration/StoryRss2142.xml'),
74 ('כל ערוץ יחסים', 'http://www.ynet.co.il/Integration/StoryRss3925.xml'),
75 ('News', 'https://www.ynet.co.il/3rdparty/mobile/rss/ynetnews/3082/'),
76 ('News updates', 'https://www.ynet.co.il/3rdparty/mobile/rss/ynetnews/3089/'),
77 ('Opinion', 'https://www.ynet.co.il/3rdparty/mobile/rss/ynetnews/3084/'),
78 ('Culture', 'https://www.ynet.co.il/3rdparty/mobile/rss/ynetnews/3086/'),
79 ('Jewish', 'https://www.ynet.co.il/3rdparty/mobile/rss/ynetnews/3443/'),
80 ]