From 51d974c8e2626f49d68b750ac0017f01e95d2022 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 17 Feb 2011 10:23:11 -0700 Subject: [PATCH] Big Hollywood by DM. Fixes #9019 (New recipe for Big Hollywood site) --- resources/images/news/bighollywood.png | Bin 0 -> 2001 bytes resources/recipes/bighollywood.recipe | 63 +++++++++++++++++++++++++ 2 files changed, 63 insertions(+) create mode 100644 resources/images/news/bighollywood.png create mode 100644 resources/recipes/bighollywood.recipe diff --git a/resources/images/news/bighollywood.png b/resources/images/news/bighollywood.png new file mode 100644 index 0000000000000000000000000000000000000000..9fc42b2fd48dd828d77e57302851acb55dedd1cb GIT binary patch literal 2001 zcmV;?2QK)DP)7ym~3NTr;! zjzTmjGz?-gq*Ag(wo1}Q@5Q%I%{lrj%lkezpZWd%{mwbhbDr&-oSpuXL`1l|ySqC( z>#1&Cv0FEB%ouUdAhBgj^J~5hJ;cV1&A+pS(20l;ckN=nstn=sbH$l()+}-RcCkyB%D=(|@7xj3 zo)sTF5R;R|j0`OdPhh@Ajm+^ob`&R06sJuSJ9H576qhnR=FKyoH*OROnIGi`4=|J3 zs8QmcJtD4d%bPc1c(@oGECmx1%<;$#>@-P{9b}y6&-Hz7uD&OiOqwJvSt5=bClZ>r z95^8Q`)j-}U#e*U$`p#vpI`X|uV0J%_KAUkny8>a<9K=L{rK_X=+Pp{(>B1{w_;+V z7#k~|KCN-HvNUeLetN%ktB8lXSRPH%BuR&dYaBw<$*HEPI4(71inwBh*r0(qaBi-6 z=#aQ;mj*5_);Qg}>;2}<;_~I9ySr$YK^BhTQE=>7v9xsVTsJp2x1=P^lbWh$a*C&? zNXQ^~M$@L^g$of8+1c6I6`oM;0b015o2eK{4dpy(AQ_uJA>G}F~c38AS7LOyD zUcD;j=a;!2E;wX}*uK3v0A++Mo|vcw@Eyr$#0ZgOh~oYG>uKFO5m&_(8K0eJ$HT(( zeQ>az$>xg}i}mY^7cYvpZi&9WVy#-H0nm@}%MHN9ZQGh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bWIFflPLFfuJM jH&ih*Ix#ppG&C(RH##sd+wfJj00000NkvXXu0mjfx$deq literal 0 HcmV?d00001 diff --git a/resources/recipes/bighollywood.recipe b/resources/recipes/bighollywood.recipe new file mode 100644 index 0000000000..7213bd3257 --- /dev/null +++ b/resources/recipes/bighollywood.recipe @@ -0,0 +1,63 @@ +__license__ = 'GPL v3' +__copyright__ = '2011, Darko Miletic ' +''' +bighollywood.breitbart.com +''' + +from calibre.web.feeds.news import BasicNewsRecipe + +class BigHollywood(BasicNewsRecipe): + title = 'Big Hollywood' + __author__ = 'Darko Miletic' + description = 'News and articles from the media world' + publisher = 'Big Hollywood' + category = 'news, media, art, literature, movies, politics, USA, Hollywood' + oldest_article = 7 + max_articles_per_feed = 200 + no_stylesheets = True + encoding = 'utf8' + use_embedded_content = False + language = 'en' + remove_empty_feeds = True + publication_type = 'blog' + extra_css = """ + body{font-family: Arial,sans-serif } + """ + + conversion_options = { + 'comment' : description + , 'tags' : category + , 'publisher' : publisher + , 'language' : language + } + + keep_only_tags=[dict(attrs={'class':'postcontent'})] + remove_tags = [ + dict(name=['meta','link','link','iframe','embed','object']) + ,dict(name='p', attrs={'class':['post_meta_links','postfooter']}) + ] + remove_attributes=['original','onclick'] + + feeds = [(u'Articles', u'http://bighollywood.breitbart.com/feed/')] + + def preprocess_html(self, soup): + for item in soup.findAll(style=True): + del item['style'] + for item in soup.findAll('a'): + limg = item.find('img') + if item.string is not None: + str = item.string + item.replaceWith(str) + else: + if limg: + if limg['src'].endswith('BlogPrintButton.png'): + limg.extract() + item.name = 'div' + item.attrs = [] + else: + str = self.tag_to_string(item) + item.replaceWith(str) + for item in soup.findAll('img'): + if not item.has_key('alt'): + item['alt'] = 'image' + return soup