mirror of
				https://github.com/kovidgoyal/calibre.git
				synced 2025-11-04 03:27:00 -05:00 
			
		
		
		
	Update Something Awful
This commit is contained in:
		
							parent
							
								
									0ca5ffc49f
								
							
						
					
					
						commit
						2a0f6bbeae
					
				@ -1,4 +1,3 @@
 | 
				
			|||||||
import re
 | 
					 | 
				
			||||||
from calibre.web.feeds.news import BasicNewsRecipe
 | 
					from calibre.web.feeds.news import BasicNewsRecipe
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class SomethingAwfulRecipe(BasicNewsRecipe):
 | 
					class SomethingAwfulRecipe(BasicNewsRecipe):
 | 
				
			||||||
@ -6,8 +5,7 @@ class SomethingAwfulRecipe(BasicNewsRecipe):
 | 
				
			|||||||
    __author__ = 'atordo'
 | 
					    __author__ = 'atordo'
 | 
				
			||||||
    description = 'The Internet Makes You Stupid'
 | 
					    description = 'The Internet Makes You Stupid'
 | 
				
			||||||
    cover_url = 'http://i.somethingawful.com/core/head-logo-bluegren.png'
 | 
					    cover_url = 'http://i.somethingawful.com/core/head-logo-bluegren.png'
 | 
				
			||||||
    masthead_url = 'http://i.somethingawful.com/core/head-logo-bluegren.png'
 | 
					    oldest_article = 15
 | 
				
			||||||
    oldest_article = 7
 | 
					 | 
				
			||||||
    max_articles_per_feed = 50
 | 
					    max_articles_per_feed = 50
 | 
				
			||||||
    auto_cleanup = False
 | 
					    auto_cleanup = False
 | 
				
			||||||
    no_stylesheets = True
 | 
					    no_stylesheets = True
 | 
				
			||||||
@ -16,27 +14,21 @@ class SomethingAwfulRecipe(BasicNewsRecipe):
 | 
				
			|||||||
    use_embedded_content  = False
 | 
					    use_embedded_content  = False
 | 
				
			||||||
    remove_empty_feeds = True
 | 
					    remove_empty_feeds = True
 | 
				
			||||||
    publication_type = 'magazine'
 | 
					    publication_type = 'magazine'
 | 
				
			||||||
 | 
					    reverse_article_order = True
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    recursions = 1
 | 
					    recursions = 1
 | 
				
			||||||
    match_regexps = [r'\?page=\d+$']
 | 
					    match_regexps = [r'^http://www.somethingawful.com/.+/.+/\d{1,2}/$']
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    preprocess_regexps = [
 | 
					    remove_attributes = ['align', 'alt', 'valign']
 | 
				
			||||||
        (re.compile(r'<!-- content end-->.*</body>', re.DOTALL), lambda match: '</body>')
 | 
					 | 
				
			||||||
    ]
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    remove_attributes = [ 'align', 'alt', 'valign' ]
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    keep_only_tags = [
 | 
					    keep_only_tags = [
 | 
				
			||||||
        dict(name='div', attrs={'class':'content_area'})
 | 
					        dict(name='div', attrs={'class':'article_head'})
 | 
				
			||||||
#       ,dict(name='p', attrs={'class':'pagebar'})
 | 
					       ,dict(name='div', attrs={'class':'organ article'})
 | 
				
			||||||
    ]
 | 
					       ,dict(name='ul', attrs={'class':'pager'})
 | 
				
			||||||
    remove_tags = [
 | 
					 | 
				
			||||||
        dict(name='div', attrs={'class':['column_box','featurenav','social']})
 | 
					 | 
				
			||||||
       ,dict(name='div', attrs={'id':'sidebar'})
 | 
					 | 
				
			||||||
       ,dict(name='a', attrs={'class':'curpage'})
 | 
					 | 
				
			||||||
    ]
 | 
					    ]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    extra_css = '''
 | 
					    extra_css = '''
 | 
				
			||||||
 | 
					        .author{font-size:small} .date{font-size:small}
 | 
				
			||||||
        .byline{font-size:small} .font_big{font-size:large}
 | 
					        .byline{font-size:small} .font_big{font-size:large}
 | 
				
			||||||
        .compat5{font-weight:bold} .accentbox{background-color:#E3E3E3; border:solid black}
 | 
					        .compat5{font-weight:bold} .accentbox{background-color:#E3E3E3; border:solid black}
 | 
				
			||||||
        img{margin-bottom:0.4em; display:block; margin-left: auto; margin-right:auto}
 | 
					        img{margin-bottom:0.4em; display:block; margin-left: auto; margin-right:auto}
 | 
				
			||||||
@ -53,7 +45,7 @@ class SomethingAwfulRecipe(BasicNewsRecipe):
 | 
				
			|||||||
        ,('The Great Goon Database', 'http://www.somethingawful.com/rss/great-goon-database.rss.xml')
 | 
					        ,('The Great Goon Database', 'http://www.somethingawful.com/rss/great-goon-database.rss.xml')
 | 
				
			||||||
        ,('Livejournal Theater', 'http://www.somethingawful.com/rss/livejournal-theater.rss.xml')
 | 
					        ,('Livejournal Theater', 'http://www.somethingawful.com/rss/livejournal-theater.rss.xml')
 | 
				
			||||||
        ,('Joystick Token Healthpack', 'http://www.somethingawful.com/rss/token-healthpack.rss.xml')
 | 
					        ,('Joystick Token Healthpack', 'http://www.somethingawful.com/rss/token-healthpack.rss.xml')
 | 
				
			||||||
        #,('Webcam Ward', 'http://www.somethingawful.com/rss/webcam-ward.rss.xml')
 | 
					        ,('Webcam Ward', 'http://www.somethingawful.com/rss/webcam-ward.rss.xml')
 | 
				
			||||||
        ,('Features / Articles', 'http://www.somethingawful.com/rss/feature-articles.rss.xml')
 | 
					        ,('Features / Articles', 'http://www.somethingawful.com/rss/feature-articles.rss.xml')
 | 
				
			||||||
        ,('Guides', 'http://www.somethingawful.com/rss/guides.rss.xml')
 | 
					        ,('Guides', 'http://www.somethingawful.com/rss/guides.rss.xml')
 | 
				
			||||||
        ,('Legal Threats', 'http://www.somethingawful.com/rss/legal-threats.rss.xml')
 | 
					        ,('Legal Threats', 'http://www.somethingawful.com/rss/legal-threats.rss.xml')
 | 
				
			||||||
@ -77,6 +69,7 @@ class SomethingAwfulRecipe(BasicNewsRecipe):
 | 
				
			|||||||
        ,('Johnston Checks In', 'http://www.somethingawful.com/rss/levi-johnston.rss.xml')
 | 
					        ,('Johnston Checks In', 'http://www.somethingawful.com/rss/levi-johnston.rss.xml')
 | 
				
			||||||
        ,('Twitter Tuesday', 'http://www.somethingawful.com/rss/twitter-tuesday.rss.xml')
 | 
					        ,('Twitter Tuesday', 'http://www.somethingawful.com/rss/twitter-tuesday.rss.xml')
 | 
				
			||||||
        ,('Music Article', 'http://www.somethingawful.com/rss/music-article.rss.xml')
 | 
					        ,('Music Article', 'http://www.somethingawful.com/rss/music-article.rss.xml')
 | 
				
			||||||
 | 
					        ,('The Everdraed Showcase', 'http://www.somethingawful.com/rss/everdraed-showcase.xml')
 | 
				
			||||||
        ,('Reviews [Games]', 'http://www.somethingawful.com/rss/game-reviews.rss.xml')
 | 
					        ,('Reviews [Games]', 'http://www.somethingawful.com/rss/game-reviews.rss.xml')
 | 
				
			||||||
        ,('Reviews [Movies]', 'http://www.somethingawful.com/rss/movie-reviews.rss.xml')
 | 
					        ,('Reviews [Movies]', 'http://www.somethingawful.com/rss/movie-reviews.rss.xml')
 | 
				
			||||||
        ,('Rom Pit', 'http://www.somethingawful.com/rss/rom-pit.rss.xml')
 | 
					        ,('Rom Pit', 'http://www.somethingawful.com/rss/rom-pit.rss.xml')
 | 
				
			||||||
@ -92,4 +85,6 @@ class SomethingAwfulRecipe(BasicNewsRecipe):
 | 
				
			|||||||
        ,('Garbage Day', 'http://www.somethingawful.com/rss/garbage-day.rss.xml')
 | 
					        ,('Garbage Day', 'http://www.somethingawful.com/rss/garbage-day.rss.xml')
 | 
				
			||||||
        ,('WTF, D&D!?', 'http://www.somethingawful.com/rss/dungeons-and-dragons.rss.xml')
 | 
					        ,('WTF, D&D!?', 'http://www.somethingawful.com/rss/dungeons-and-dragons.rss.xml')
 | 
				
			||||||
        ,('Current Releases', 'http://www.somethingawful.com/rss/current-movie-reviews.rss.xml')
 | 
					        ,('Current Releases', 'http://www.somethingawful.com/rss/current-movie-reviews.rss.xml')
 | 
				
			||||||
 | 
					        ,('Awful Things for Sale', 'http://www.somethingawful.com/rss/awful-things-sale.xml')
 | 
				
			||||||
    ]
 | 
					    ]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user