mirror of
				https://github.com/kovidgoyal/calibre.git
				synced 2025-11-04 03:27:00 -05:00 
			
		
		
		
	Updated golem.de
This commit is contained in:
		
							parent
							
								
									902dc7aad6
								
							
						
					
					
						commit
						ac320e4b57
					
				@ -1,50 +1,60 @@
 | 
				
			|||||||
#!/usr/bin/env  python
 | 
					from calibre.web.feeds.recipes import BasicNewsRecipe
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					class AdvancedUserRecipe1303841067(BasicNewsRecipe):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from calibre.web.feeds.news import BasicNewsRecipe
 | 
					 | 
				
			||||||
class golem_ger(BasicNewsRecipe):
 | 
					 | 
				
			||||||
    title          = u'Golem.de'
 | 
					    title          = u'Golem.de'
 | 
				
			||||||
    language = 'de'
 | 
					    __author__  = 'schuster'
 | 
				
			||||||
    __author__ = 'Kovid Goyal'
 | 
					
 | 
				
			||||||
    oldest_article = 7
 | 
					    oldest_article = 7
 | 
				
			||||||
    max_articles_per_feed = 100
 | 
					    max_articles_per_feed = 10
 | 
				
			||||||
    language              = 'de'
 | 
					 | 
				
			||||||
    lang                  = 'de-DE'
 | 
					 | 
				
			||||||
    no_stylesheets         = True
 | 
					    no_stylesheets         = True
 | 
				
			||||||
    encoding              = 'iso-8859-1'
 | 
					    use_embedded_content   = False
 | 
				
			||||||
    recursions = 1
 | 
					    language               = 'de'
 | 
				
			||||||
    match_regexps = [r'http://www.golem.de/.*.html']
 | 
					    cover_url = 'http://www.e-energy.de/images/logo_golem.jpg'
 | 
				
			||||||
 | 
					    masthead_url = 'http://www.golem.de/staticrl/images/logo.png'
 | 
				
			||||||
 | 
					    extra_css = '''
 | 
				
			||||||
 | 
					                    h2{font-family:Arial,Helvetica,sans-serif; font-size: x-small;}
 | 
				
			||||||
 | 
					                    h1{ font-family:Arial,Helvetica,sans-serif;  font-size:x-large; font-weight:bold;}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    keep_only_tags     = [
 | 
					                '''
 | 
				
			||||||
                               dict(name='h1', attrs={'class':'artikelhead'}),
 | 
					    remove_javascript      = True
 | 
				
			||||||
                               dict(name='p', attrs={'class':'teaser'}),
 | 
					    remove_tags_befor = [dict(name='header', attrs={'class':'cluster-header'})]
 | 
				
			||||||
                               dict(name='div', attrs={'class':'artikeltext'}),
 | 
					    remove_tags_after = [dict(name='p', attrs={'class':'meta'})]
 | 
				
			||||||
                               dict(name='h2', attrs={'id':'artikelhead'}),
 | 
					    remove_tags = [dict(rel='nofollow'),
 | 
				
			||||||
 | 
					           dict(name='header', attrs={'id':'header'}),
 | 
				
			||||||
 | 
					           dict(name='div', attrs={'class':'dh1'}),
 | 
				
			||||||
 | 
					           dict(name='label', attrs={'class':'implied'}),
 | 
				
			||||||
 | 
					           dict(name='section', attrs={'id':'comments'}),
 | 
				
			||||||
 | 
					           dict(name='li', attrs={'class':'gg_prebackcounterItem'}),
 | 
				
			||||||
 | 
					           dict(name='li', attrs={'class':'gg_prebackcounterItem gg_embeddedIndexCounter'}),
 | 
				
			||||||
 | 
					           dict(name='img', attrs={'class':'gg_embeddedIconRight gg_embeddedIconFS gg_cursorpointer'}),
 | 
				
			||||||
 | 
					           dict(name='div', attrs={'target':'_blank'})
 | 
				
			||||||
]
 | 
					]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    def get_browser(self, *args, **kwargs):
 | 
				
			||||||
 | 
					       from calibre import browser
 | 
				
			||||||
 | 
					       kwargs['user_agent'] = 'mozilla'
 | 
				
			||||||
 | 
					       return browser(*args, **kwargs)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    def get_article_url(self, article):
 | 
				
			||||||
 | 
					        return article.get('id', article.get('guid', None))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    remove_tags = [
 | 
					    def preprocess_html(self, soup):
 | 
				
			||||||
                    dict(name='div', attrs={'id':['similarContent','topContentWrapper','storycarousel','aboveFootPromo','comments','toolbar','breadcrumbs','commentlink','sidebar','rightColumn']}),
 | 
					        for alink in soup.findAll('a'):
 | 
				
			||||||
                    dict(name='div', attrs={'class':['gg_embeddedSubText','gg_embeddedIndex gg_solid','gg_toOldGallery','golemGallery']}),
 | 
					            if alink.string is not None:
 | 
				
			||||||
                    dict(name='img', attrs={'class':['gg_embedded','gg_embeddedIconRight gg_embeddedIconFS gg_cursorpointer']}),
 | 
					               tstr = alink.string
 | 
				
			||||||
                    dict(name='td', attrs={'class':['xsmall']}),
 | 
					               alink.replaceWith(tstr)
 | 
				
			||||||
                    ]
 | 
					        return soup
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    feeds          = [(u'Audio/Video', u'http://rss.golem.de/rss.php?tp=av&feed=RSS2.0'),
 | 
				
			||||||
    # remove_tags_after  = [
 | 
					 | 
				
			||||||
      #                      dict(name='div', attrs={'id':['contentad2']})
 | 
					 | 
				
			||||||
       #                 ]
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    feeds          = [
 | 
					 | 
				
			||||||
                      (u'Golem.de', u'http://rss.golem.de/rss.php?feed=ATOM1.0'),
 | 
					 | 
				
			||||||
                      (u'Audio/Video', u'http://rss.golem.de/rss.php?tp=av&feed=RSS2.0'),
 | 
					 | 
				
			||||||
                          (u'Foto', u'http://rss.golem.de/rss.php?tp=foto&feed=RSS2.0'),
 | 
					                          (u'Foto', u'http://rss.golem.de/rss.php?tp=foto&feed=RSS2.0'),
 | 
				
			||||||
                          (u'Games', u'http://rss.golem.de/rss.php?tp=games&feed=RSS2.0'),
 | 
					                          (u'Games', u'http://rss.golem.de/rss.php?tp=games&feed=RSS2.0'),
 | 
				
			||||||
                      (u'Internet', u'http://rss.golem.de/rss.php?tp=inet&feed=RSS1.0'),
 | 
					                          (u'Handy', u'http://rss.golem.de/rss.php?tp=handy&feed=RSS2.0'),
 | 
				
			||||||
                      (u'Mobil', u'http://rss.golem.de/rss.php?tp=mc&feed=ATOM1.0'),
 | 
					                          (u'Internet', u'http://rss.golem.de/rss.php?tp=inet&feed=RSS2.0'),
 | 
				
			||||||
                      (u'Internet', u'http://rss.golem.de/rss.php?tp=inet&feed=RSS1.0'),
 | 
					                          (u'Mobile', u'http://rss.golem.de/rss.php?tp=mc&feed=RSS2.0'),
 | 
				
			||||||
                      (u'Politik/Recht', u'http://rss.golem.de/rss.php?tp=pol&feed=ATOM1.0'),
 | 
					                          (u'OSS', u'http://rss.golem.de/rss.php?tp=oss&feed=RSS2.0'),
 | 
				
			||||||
 | 
					                          (u'Politik/Recht', u'http://rss.golem.de/rss.php?tp=pol&feed=RSS2.0'),
 | 
				
			||||||
 | 
					                          (u'Security', u'http://rss.golem.de/rss.php?tp=sec&feed=RSS2.0'),
 | 
				
			||||||
                          (u'Desktop-Applikationen', u'http://rss.golem.de/rss.php?tp=apps&feed=RSS2.0'),
 | 
					                          (u'Desktop-Applikationen', u'http://rss.golem.de/rss.php?tp=apps&feed=RSS2.0'),
 | 
				
			||||||
                          (u'Software-Entwicklung', u'http://rss.golem.de/rss.php?tp=dev&feed=RSS2.0'),
 | 
					                          (u'Software-Entwicklung', u'http://rss.golem.de/rss.php?tp=dev&feed=RSS2.0'),
 | 
				
			||||||
                          (u'Wirtschaft', u'http://rss.golem.de/rss.php?tp=wirtschaft&feed=RSS2.0'),
 | 
					                          (u'Wirtschaft', u'http://rss.golem.de/rss.php?tp=wirtschaft&feed=RSS2.0'),
 | 
				
			||||||
@ -53,31 +63,8 @@ class golem_ger(BasicNewsRecipe):
 | 
				
			|||||||
                          (u'Networld', u'http://rss.golem.de/rss.php?r=nw&feed=RSS2.0'),
 | 
					                          (u'Networld', u'http://rss.golem.de/rss.php?r=nw&feed=RSS2.0'),
 | 
				
			||||||
                          (u'Entertainment', u'http://rss.golem.de/rss.php?r=et&feed=RSS2.0'),
 | 
					                          (u'Entertainment', u'http://rss.golem.de/rss.php?r=et&feed=RSS2.0'),
 | 
				
			||||||
                          (u'TK', u'http://rss.golem.de/rss.php?r=tk&feed=RSS2.0'),
 | 
					                          (u'TK', u'http://rss.golem.de/rss.php?r=tk&feed=RSS2.0'),
 | 
				
			||||||
                      (u'E-Commerce', u'http://rss.golem.de/rss.php?r=ec&feed=RSS2.0'),
 | 
					                          (u'Wirtschaft', u'http://rss.golem.de/rss.php?r=wi&feed=RSS2.0'),
 | 
				
			||||||
                      (u'Unternehmen/Maerkte', u'http://rss.golem.de/rss.php?r=wi&feed=RSS2.0')
 | 
					                          (u'E-Commerce', u'http://rss.golem.de/rss.php?r=ec&feed=RSS2.0')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
]
 | 
					]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    feeds          = [
 | 
					 | 
				
			||||||
                      (u'Golem.de', u'http://rss.golem.de/rss.php?feed=ATOM1.0'),
 | 
					 | 
				
			||||||
                      (u'Mobil', u'http://rss.golem.de/rss.php?tp=mc&feed=feed=RSS2.0'),
 | 
					 | 
				
			||||||
                      (u'OSS', u'http://rss.golem.de/rss.php?tp=oss&feed=RSS2.0'),
 | 
					 | 
				
			||||||
                      (u'Politik/Recht', u'http://rss.golem.de/rss.php?tp=pol&feed=RSS2.0'),
 | 
					 | 
				
			||||||
                      (u'Desktop-Applikationen', u'http://rss.golem.de/rss.php?tp=apps&feed=RSS2.0'),
 | 
					 | 
				
			||||||
                      (u'Software-Entwicklung', u'http://rss.golem.de/rss.php?tp=dev&feed=RSS2.0'),
 | 
					 | 
				
			||||||
                      ]
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    extra_css = '''
 | 
					 | 
				
			||||||
                h1 {color:#0066CC;font-family:Arial,Helvetica,sans-serif; font-size:30px; font-size-adjust:none; font-stretch:normal; font-style:normal; font-variant:normal; font-weight:bold; line-height:20px;margin-bottom:2 em;}
 | 
					 | 
				
			||||||
                h2 {color:#4D4D4D;font-family:Arial,Helvetica,sans-serif; font-size:22px; font-size-adjust:none; font-stretch:normal; font-style:normal; font-variant:normal; font-weight:bold; line-height:16px; }
 | 
					 | 
				
			||||||
                h3 {color:#4D4D4D;font-family:Arial,Helvetica,sans-serif; font-size:x-small; font-size-adjust:none; font-stretch:normal; font-style:normal; font-variant:normal; font-weight:normal; line-height:5px;}
 | 
					 | 
				
			||||||
                h4 {color:#333333; font-family:Arial,Helvetica,sans-serif;font-size:13px; font-size-adjust:none; font-stretch:normal; font-style:normal; font-variant:normal; font-weight:bold; line-height:13px; }
 | 
					 | 
				
			||||||
                h5 {color:#333333; font-family:Arial,Helvetica,sans-serif; font-size:11px; font-size-adjust:none; font-stretch:normal; font-style:normal; font-variant:normal; font-weight:bold; line-height:11px; text-transform:uppercase;}
 | 
					 | 
				
			||||||
                .teaser {font-style:italic;font-size:12pt;margin-bottom:15pt;}
 | 
					 | 
				
			||||||
                .xsmall{font-style:italic;font-size:x-small;}
 | 
					 | 
				
			||||||
                .td{font-style:italic;font-size:x-small;}
 | 
					 | 
				
			||||||
                img {align:left;}
 | 
					 | 
				
			||||||
                '''
 | 
					 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user