From 6e2987ad49dc382fd11e70cf5da811f59fc4b3c8 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 11 Oct 2010 19:03:45 -0600 Subject: [PATCH] Rolling Stones by Tony Stegall --- resources/images/news/rstones.png | Bin 0 -> 1318 bytes resources/recipes/rstones.recipe | 82 ++++++++++++++++++++++++++++++ 2 files changed, 82 insertions(+) create mode 100644 resources/images/news/rstones.png create mode 100644 resources/recipes/rstones.recipe diff --git a/resources/images/news/rstones.png b/resources/images/news/rstones.png new file mode 100644 index 0000000000000000000000000000000000000000..7f6159c13c3f6e74bcf1258a10a37d71caf9dc46 GIT binary patch literal 1318 zcmZ9Me>l?#9LK*~Y$GvNYv)lm^y7rvW{)2uhHo~lMoTJ|-wj7BWA|X#B}FP^$R+($ z=h1A-QGSFX+DXl2n;ySbS10+kPT7$kx9YFE&+~bIUZ3alJgurGT2VE#suf;be7y}#gN=@FmB8g8Ckntcq?}6hu`gGH!jN%#6{7mIe@vPgJsp3c5 z(mt~|`;$Te69gzAsE0Jb>0K2fL4gundddUBjntnzcy2%u@&3J}%&^_(qs|H`Ps~qw zcVjvs5JBhN{W#$JC~55aJkXa)rRD(M98Lz`5({k}NnV%^>A*ba9%*dIr^%c`LfTR4 zGr4#e@cP3_R=BDzUgZ!5yWY?DxB?d@Tl7GLXL>fBZtqy#Jg=RLsrmR?Uo-JyU?40T zLaBY5X7PgsETG1wBqs+f-A$~JAsdEzdw1*rM;wX?V4a(1_PFuBY9d||V^XZFn@lq* zQi63Yckj0D2^8I8PLTGAg0{0-Y0-P?U&cyItgiD~0&Pq4Mjy~`YiG8kuX%wq1ro}x}k8xZ|{BA>V7TeHkv6|(E2InM998Mq-F(($dR~6}tDRKEYsGzOQ znrdvxM%WE7p*Xq|P7r_?9Bxhj)V&T{?2@_IWzdm&#r<$FG(Cgc^eUn;3O@CZN}QaQ zTKdBDgluR!8RzyBjEBw$`IR70QfRx`)w6S_UvWf@QV4&!S)$QIP^xHe2BkNs_pF~9 zpQ};4Pn`iwk%eLR@gBxDX1R}=xRpqNWL~&=LqS5!*)1N(zcaINCq*3?k?a0v7q?r$ ztcqEQt1F&0f4QJgB_-~gIy)&gMB;^BeQni2J9Gi1-qkZ(>i`cjln4LLfFoX(ZGVhe zDSsTins^{K99v-|Q8kCIY9Il&#d$rhnkO{8cC4+hZ=?lIy2RybXV-MoWO50aCfg)z zd_3Yn&#kT^l<_J4Ch`|0y~o6NMzZFo-qO``ivXk$~(1J?Kwyd`LaTx5+D99A9xDO8Xs3tj>&tkQ+D~dPDT2R{JgJ9~T1<^5DEgRb6Z-TZ$>7?b*AR0hJCe%;iEg&dxclM@>d& z-{}6#mXuwGQlcYLj*_F2kLmyr@dUj6mnH-fT*-Jmnc!%TchW6ZWG?(a!m*_2ICk3q a1R{y-Nctw^Mo!M@1i)_>1FZ87Kk+Z%lt>5w literal 0 HcmV?d00001 diff --git a/resources/recipes/rstones.recipe b/resources/recipes/rstones.recipe new file mode 100644 index 0000000000..fa09701e15 --- /dev/null +++ b/resources/recipes/rstones.recipe @@ -0,0 +1,82 @@ +#!/usr/bin/env python +__license__ = 'GPL v3' +__author__ = 'Tony Stegall' +__copyright__ = '2010, Tony Stegall or Tonythebookworm on mobileread.com' +__version__ = 'v1.01' +__date__ = '07, October 2010' +__description__ = 'Rolling Stones Mag' + +''' +http://www.rollingstone.com +''' + +from calibre.web.feeds.news import BasicNewsRecipe + +class RollingStones(BasicNewsRecipe): + __author__ = 'Tony Stegall' + description = 'Rolling Stones Mag' + cover_url = 'http://gallery.celebritypro.com/data/media/648/kid-rock-rolling-stone-cover.jpg' + masthead_url = 'http://origin.myfonts.com/s/ec/cc-200804/Rolling_Stone-logo.gif' + + + title = 'Rolling Stones Mag' + category = 'Music Reviews, Movie Reviews, entertainment news' + + language = 'en' + timefmt = '[%a, %d %b, %Y]' + + oldest_article = 15 + max_articles_per_feed = 25 + use_embedded_content = False + no_stylesheets = True + + remove_javascript = True + ##################################################################################### + # cleanup section # + ##################################################################################### + keep_only_tags = [ + dict(name='div', attrs={'class':['c65l']}), + dict(name='div', attrs={'id':['col1']}), + + + ] + remove_tags = [ + dict(name='div', attrs={'class': ['storyActions upper','storyActions lowerArticleNav']}), + dict(name='div', attrs={'id': ['comments','related']}), + ] + + + feeds = [ + (u'News', u'http://www.rollingstone.com/siteServices/rss/allNews'), + (u'Blogs', u'http://www.rollingstone.com/siteServices/rss/allBlogs'), + (u'Movie Reviews', u'http://www.rollingstone.com/siteServices/rss/movieReviews'), + (u'Album Reviews', u'http://www.rollingstone.com/siteServices/rss/albumReviews'), + (u'Song Reviews', u'http://www.rollingstone.com/siteServices/rss/songReviews'), + + + ] + + + + def get_article_url(self, article): + return article.get('guid', None) + + + def append_page(self, soup, appendtag, position): + ''' + Some are the articles are multipage so the below function + will get the articles that have + ''' + pager = soup.find('li',attrs={'class':'next'}) + if pager: + nexturl = pager.a['href'] + soup2 = self.index_to_soup(nexturl) + texttag = soup2.find('div', attrs={'id':'storyTextContainer'}) + for it in texttag.findAll(style=True): + del it['style'] + newpos = len(texttag.contents) + self.append_page(soup2,texttag,newpos) + texttag.extract() + appendtag.insert(position,texttag) + +