mirror of
				https://github.com/kovidgoyal/calibre.git
				synced 2025-11-04 03:27:00 -05:00 
			
		
		
		
	Various Czech news source by FunThomas. Fixes #8562 (New Czech recipes)
This commit is contained in:
		
							parent
							
								
									e526bcc336
								
							
						
					
					
						commit
						0906058fb5
					
				
							
								
								
									
										43
									
								
								resources/recipes/abc.recipe
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										43
									
								
								resources/recipes/abc.recipe
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,43 @@
 | 
				
			|||||||
 | 
					import re
 | 
				
			||||||
 | 
					from calibre.web.feeds.news import BasicNewsRecipe
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					class ABCRecipe(BasicNewsRecipe):
 | 
				
			||||||
 | 
					  title          = u'ABC Linuxu'
 | 
				
			||||||
 | 
					  oldest_article = 5
 | 
				
			||||||
 | 
					  max_articles_per_feed = 3#5
 | 
				
			||||||
 | 
					  __author__ = 'Funthomas'
 | 
				
			||||||
 | 
					  language = 'cs'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  feeds = [
 | 
				
			||||||
 | 
					    #(u'Blogy', u'http://www.abclinuxu.cz/auto/blogDigest.rss'),
 | 
				
			||||||
 | 
					    (u'Články', u'http://www.abclinuxu.cz/auto/abc.rss'),
 | 
				
			||||||
 | 
					    (u'Zprávičky','http://www.abclinuxu.cz/auto/zpravicky.rss')
 | 
				
			||||||
 | 
					  ]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  remove_javascript = True
 | 
				
			||||||
 | 
					  no_stylesheets    = True
 | 
				
			||||||
 | 
					  remove_attributes = ['width','height']
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  remove_tags_before = dict(name='h1')
 | 
				
			||||||
 | 
					  remove_tags = [
 | 
				
			||||||
 | 
					    dict(attrs={'class':['meta-vypis','page_tools','cl_perex']}),
 | 
				
			||||||
 | 
					    dict(attrs={'class':['cl_nadpis-link','komix-nav']})
 | 
				
			||||||
 | 
					  ]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  remove_tags_after = [
 | 
				
			||||||
 | 
					    dict(name='div',attrs={'class':['cl_perex','komix-nav']}),
 | 
				
			||||||
 | 
					    dict(attrs={'class':['meta-vypis','page_tools']}),
 | 
				
			||||||
 | 
					    dict(name='',attrs={'':''}),
 | 
				
			||||||
 | 
					  ]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  preprocess_regexps = [
 | 
				
			||||||
 | 
					    (re.compile(r'</div>.*<p class="perex">', re.DOTALL),lambda match: '</div><p class="perex">')
 | 
				
			||||||
 | 
					  ]
 | 
				
			||||||
 | 
					  def print_version(self, url):
 | 
				
			||||||
 | 
					    return url + '?varianta=print&noDiz'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  extra_css = '''
 | 
				
			||||||
 | 
					            h1 {font-size:130%; font-weight:bold}
 | 
				
			||||||
 | 
					            h3 {font-size:111%; font-weight:bold}
 | 
				
			||||||
 | 
					        '''
 | 
				
			||||||
							
								
								
									
										54
									
								
								resources/recipes/idnes.recipe
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										54
									
								
								resources/recipes/idnes.recipe
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,54 @@
 | 
				
			|||||||
 | 
					from calibre.web.feeds.recipes import BasicNewsRecipe
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					class iHeuteRecipe(BasicNewsRecipe):
 | 
				
			||||||
 | 
					    __author__  = 'FunThomas'
 | 
				
			||||||
 | 
					    title = u'iDnes.cz'
 | 
				
			||||||
 | 
					    publisher = u'MAFRA a.s.'
 | 
				
			||||||
 | 
					    description = 'iDNES.cz Zprávy, Technet, Komiksy a další'
 | 
				
			||||||
 | 
					    oldest_article = 3
 | 
				
			||||||
 | 
					    max_articles_per_feed = 2
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    feeds = [
 | 
				
			||||||
 | 
					            (u'Zprávy', u'http://servis.idnes.cz/rss.asp?c=zpravodaj'),
 | 
				
			||||||
 | 
					            (u'Sport', u'http://servis.idnes.cz/rss.asp?c=sport'),
 | 
				
			||||||
 | 
					            (u'Technet', u'http://servis.idnes.cz/rss.asp?c=technet'),
 | 
				
			||||||
 | 
					            (u'Mobil', u'http://servis.idnes.cz/rss.asp?c=mobil'),
 | 
				
			||||||
 | 
					            (u'Ekonomika', u'http://servis.idnes.cz/rss.asp?c=ekonomikah'),
 | 
				
			||||||
 | 
					            #(u'Kultura', u'http://servis.idnes.cz/rss.asp?c=kultura'),
 | 
				
			||||||
 | 
					            (u'Cestování', u'http://servis.idnes.cz/rss.asp?c=iglobe'),
 | 
				
			||||||
 | 
					            #(u'Kavárna', u'http://servis.idnes.cz/rss.asp?r=kavarna'),
 | 
				
			||||||
 | 
					            (u'Komixy', u'http://servis.idnes.cz/rss.asp?c=komiksy')
 | 
				
			||||||
 | 
					            ]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    encoding = 'cp1250'
 | 
				
			||||||
 | 
					    language = 'cs'
 | 
				
			||||||
 | 
					    cover_url = 'http://g.idnes.cz/u/loga-n4/idnes.gif'
 | 
				
			||||||
 | 
					    remove_javascript = True
 | 
				
			||||||
 | 
					    no_stylesheets = True
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    remove_attributes = ['width','height']
 | 
				
			||||||
 | 
					    remove_tags = [dict(name='div',   attrs={'id':['zooming']}),
 | 
				
			||||||
 | 
					                   dict(name='div',   attrs={'class':['related','mapa-wrapper']}),
 | 
				
			||||||
 | 
					                   dict(name='table', attrs={'id':['opener-img','portal']}),
 | 
				
			||||||
 | 
					                   dict(name='table', attrs={'class':['video-16ku9']})]
 | 
				
			||||||
 | 
					    remove_tags_after  = [dict(name='div',attrs={'id':['related','related2']})]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    keep_only_tags = [dict(name='div', attrs={'class':['art-full adwords-text','dil-day']})
 | 
				
			||||||
 | 
					                      ,dict(name='table',attrs={'class':['kemel-box']})]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    def print_version(self, url):
 | 
				
			||||||
 | 
					        print_url = url
 | 
				
			||||||
 | 
					        split_url = url.split("?")
 | 
				
			||||||
 | 
					        if (split_url[0].rfind('dilbert.asp')  != -1):      #dilbert komix
 | 
				
			||||||
 | 
					            print_url = print_url.replace('.htm','.gif&tisk=1')
 | 
				
			||||||
 | 
					            print_url = print_url.replace('.asp','.aspx')
 | 
				
			||||||
 | 
					        elif (split_url[0].rfind('kemel.asp')  == -1):      #not Kemel komix
 | 
				
			||||||
 | 
					            print_url = 'http://zpravy.idnes.cz/tiskni.asp?' +  split_url[1]
 | 
				
			||||||
 | 
					        #kemel                  kemel print page doesn't work
 | 
				
			||||||
 | 
					        return print_url
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    extra_css = '''
 | 
				
			||||||
 | 
					                  h1 {font-size:125%; font-weight:bold}
 | 
				
			||||||
 | 
					                  h3 {font-size:110%; font-weight:bold}
 | 
				
			||||||
 | 
					                '''
 | 
				
			||||||
							
								
								
									
										39
									
								
								resources/recipes/root.recipe
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										39
									
								
								resources/recipes/root.recipe
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,39 @@
 | 
				
			|||||||
 | 
					import re
 | 
				
			||||||
 | 
					from calibre.web.feeds.news import BasicNewsRecipe
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					class AdvancedUserRecipe1289939440(BasicNewsRecipe):
 | 
				
			||||||
 | 
					  __author__  = 'FunThomas'
 | 
				
			||||||
 | 
					  title       = u'Root.cz'
 | 
				
			||||||
 | 
					  description = u'Zprávičky a články z Root.cz'
 | 
				
			||||||
 | 
					  publisher   = u'Internet Info, s.r.o'
 | 
				
			||||||
 | 
					  oldest_article = 2               #max stari clanku ve dnech
 | 
				
			||||||
 | 
					  max_articles_per_feed = 50       #max pocet clanku na feed
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  feeds = [
 | 
				
			||||||
 | 
					    (u'Články', u'http://www.root.cz/rss/clanky/'),
 | 
				
			||||||
 | 
					    (u'Zprávičky', u'http://www.root.cz/rss/zpravicky/')
 | 
				
			||||||
 | 
					  ]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  publication_type = u'magazine'
 | 
				
			||||||
 | 
					  language = u'cs'
 | 
				
			||||||
 | 
					  no_stylesheets = True
 | 
				
			||||||
 | 
					  remove_javascript = True
 | 
				
			||||||
 | 
					  cover_url = u'http://i.iinfo.cz/urs/logo-root-bila-oranzova-cerna-111089527143118.gif'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  remove_attributes = ['width','height','href'] #,'href'
 | 
				
			||||||
 | 
					  keep_only_tags = [
 | 
				
			||||||
 | 
					    dict(name='h1'),
 | 
				
			||||||
 | 
					    dict(name='a',attrs={'class':'author'}),
 | 
				
			||||||
 | 
					    dict(name='p', attrs={'class':'intro'}),
 | 
				
			||||||
 | 
					    dict(name='div',attrs={'class':'urs'})
 | 
				
			||||||
 | 
					  ]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  preprocess_regexps = [
 | 
				
			||||||
 | 
					    (re.compile(u'<p class="perex[^"]*">[^<]*<img[^>]*>', re.DOTALL),lambda match: '<p class="intro">'),
 | 
				
			||||||
 | 
					    (re.compile(u'<h3><a name="tucnak">Tričko tučňák.*</body>', re.DOTALL),lambda match: '<!--deleted-->')
 | 
				
			||||||
 | 
					  ]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  extra_css = '''
 | 
				
			||||||
 | 
					                h1 {font-size:130%; font-weight:bold}
 | 
				
			||||||
 | 
					                h3 {font-size:111%; font-weight:bold}
 | 
				
			||||||
 | 
					              '''
 | 
				
			||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user