From 4ecab6bc9ee483ddeddb77b8681635b5ab9918e6 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 3 Feb 2010 10:54:23 -0700 Subject: [PATCH] New recipes for Gizmodo, News Straits Times, Read It Later, TidBits by Darko Miletic --- resources/images/news/gizmodo.png | Bin 0 -> 640 bytes resources/images/news/newsstraitstimes.png | Bin 0 -> 816 bytes resources/images/news/readitlater.png | Bin 0 -> 810 bytes resources/images/news/tidbits.png | Bin 0 -> 783 bytes resources/recipes/gizmodo.recipe | 40 +++++++++++++ resources/recipes/newsstraitstimes.recipe | 35 +++++++++++ resources/recipes/readitlater.recipe | 64 +++++++++++++++++++++ resources/recipes/tidbits.recipe | 53 +++++++++++++++++ 8 files changed, 192 insertions(+) create mode 100644 resources/images/news/gizmodo.png create mode 100644 resources/images/news/newsstraitstimes.png create mode 100644 resources/images/news/readitlater.png create mode 100644 resources/images/news/tidbits.png create mode 100644 resources/recipes/gizmodo.recipe create mode 100644 resources/recipes/newsstraitstimes.recipe create mode 100644 resources/recipes/readitlater.recipe create mode 100644 resources/recipes/tidbits.recipe diff --git a/resources/images/news/gizmodo.png b/resources/images/news/gizmodo.png new file mode 100644 index 0000000000000000000000000000000000000000..8f2e6f002b7719ac70fb67d31b6f5b6785d2c140 GIT binary patch literal 640 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdzwj^(N7l!{JxM1({$v_d#0*}aI zAngIhZYQ(tK!Rljj_E*J0gT&!&6&%? z2M}o7@qdy2X8D_R5z#R2RZUt7s}^Y~Bsd&sU<4{-Wb?n(G_z;R?cC6<##}SKbt1p* zK7Re$=ex_--=EK4dRTXhp6#mubDNqS`#BFhKCXVxH&fw&DtF|Q?b%mEj=h{@c_sbU zj1!iNryP=Ue#z~%zar7f%0XJ#f48z``j#MxwI`HJ6fd=OT$GC6k;$-$BmUdmo%%Aj zLpzPzbY>>sZ3xmo-$UcZ*N+IWCGg^MliL*^1$8a`S$b5mw)y>v;FF%`8m3a z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&cjSP3?3nuH4ODTbMK3?RtxVg=xjto2i<%&6~G# zA7T&dD|n=I-A%vX>7GV`MTN7JSeO`>Ou5l_K)-9rFW*HU<65+oOGNVxJkLa`%w3rj z-Y;`wTB*??K?jeMRRcIV8Tdm)> z16D6uZ5G0BV9n-vWOjCMSVKibq2A3_$+s=DSl2P#b*oFAr7yXC<+m-&YbE`sO6;_A z(-3kDKgIEwCwhPQjGtT16ivI<@T;xVExU(T{lyDe2aDevYXe&%|NfdcU0yXT)I2v? zSm8nFot-g>FOFF}yQz}FIFWJFOq0vS(K%v$@>!f7+oFB$$f;hNt7L5I`SC(?s^pUN zv`XXr2fKcWELhnY&c3(8Rxdx^Cbi7&_}<-mj*%&^sypX4o5d`Zvj2ERWJ=JUdCfj$ zjd#|y&kdUK_LKQ1*MsZ#h+hwVA-s2$^FPK@T3QA+^$|_Lw5D3(8c~vxSdwa$T$Bo= z7>o=I4Rj5RbPbF{3=OPI%&m;fbq&m|3=CA5+r&^b||EMpFO) literal 0 HcmV?d00001 diff --git a/resources/images/news/tidbits.png b/resources/images/news/tidbits.png new file mode 100644 index 0000000000000000000000000000000000000000..e64d71ec6887f57c6f66464bb90208ffe33978f9 GIT binary patch literal 783 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt_f1s;*b zK-vS0-A-oPfdtD69Mgd`SU*F|v9*U87?>OZ&!)pF42;O_6J(C3ljy)|1v9;Bzn6ZbT}F{HNh$Q zc+J$bSt)AQU2|V;y0LjrL7d+C-!coQ1j!^kah%5ZWo^`v=F_KnWG-qxab{@qpA}M9 zw&U-W^pB;ztvef5MrUr?cl6sbC5(8dK~VocSdbuT6_9tZ5GFdGcvvf6^D)(@GO~9vb(En_t_UIljh7% z5x*F=*;D4YMW6Gv?LYS2Sr(zQ=(*b@i<>-!GRYFWi!=^x%XRaAS`a(^&uuM%1+S&1 zr9P~bTNcT@Aa4EQ>{)G(Ei{%21bulR(bo8SSHv~G>G$ueWOpkbTyDgzUtjpE&4r^; zuf^edDZ>%_lBH8#?CMi1@4BU<&Gl1lWk~Cr87gnL7sQI!?l0w?|JJ}P)xc!RlMB{I zSO3<{iGF*Z+4u4Xn|>d)!(X-vGT5DK|NXyl0@LYDK)1LkF*?W`|DXQo(jPX4vSr;j z_O|Y9kFWf^$VH}Ha=(c2=Zrbm+Kzv&UM=#;_flQY?fit9Vn?Uu?va_ZJNPE|k3AwE z9(#9wEt0$(IA`aJ$z^Pjwed?sw1U=~Z_wdBzRggk)mUVbhsrmmsI_8Ov!=Q&W^~Y+ zx@i6Se!u0;OM?`7oR>^Fv43mUthU#?su{gB7ilcI{q~#91ry$-B84*F?=iLr*!urt zXm`DxsP)vV9GIX~OI#yLQW8s2t&)pUffR$0fuVt}fsw9(afqRTm5Hg9k)f`Exs`!| tvs$tsiiX_$l+3hBWDN!uRz}8Fra=854SVte<$)R)JYD@<);T3K0RR{HNE-kE literal 0 HcmV?d00001 diff --git a/resources/recipes/gizmodo.recipe b/resources/recipes/gizmodo.recipe new file mode 100644 index 0000000000..6f6e6ae0cf --- /dev/null +++ b/resources/recipes/gizmodo.recipe @@ -0,0 +1,40 @@ + +__license__ = 'GPL v3' +__copyright__ = '2010, Darko Miletic ' +''' +gizmodo.com +''' + +from calibre.web.feeds.news import BasicNewsRecipe + +class Gizmodo(BasicNewsRecipe): + title = 'Gizmodo' + __author__ = 'Darko Miletic' + description = "Gizmodo, the gadget guide. So much in love with shiny new toys, it's unnatural." + publisher = 'gizmodo.com' + category = 'news, IT, Internet, gadgets' + oldest_article = 2 + max_articles_per_feed = 100 + no_stylesheets = True + encoding = 'utf-8' + use_embedded_content = True + language = 'en' + masthead_url = 'http://cache.gawkerassets.com/assets/gizmodo.com/img/logo.png' + extra_css = ' body{font-family: "Lucida Grande",Helvetica,Arial,sans-serif} img{margin-bottom: 1em} ' + + conversion_options = { + 'comment' : description + , 'tags' : category + , 'publisher' : publisher + , 'language' : language + } + + remove_attributes = ['width','height'] + remove_tags = [dict(name='div',attrs={'class':'feedflare'})] + remove_tags_after = dict(name='div',attrs={'class':'feedflare'}) + + feeds = [(u'Articles', u'http://feeds.gawker.com/gizmodo/full')] + + def preprocess_html(self, soup): + return self.adeify_images(soup) + diff --git a/resources/recipes/newsstraitstimes.recipe b/resources/recipes/newsstraitstimes.recipe new file mode 100644 index 0000000000..ebbaca1a0e --- /dev/null +++ b/resources/recipes/newsstraitstimes.recipe @@ -0,0 +1,35 @@ + +__license__ = 'GPL v3' +__copyright__ = '2010, Darko Miletic ' +''' +www.nst.com.my +''' + +from calibre.web.feeds.news import BasicNewsRecipe + +class Newstraitstimes(BasicNewsRecipe): + title = 'New Straits Times from Malaysia' + __author__ = 'Darko Miletic' + description = 'Learning Curve, Sunday People, New Straits Times from Malaysia' + publisher = 'nst.com.my' + category = 'news, politics, Malaysia' + oldest_article = 2 + max_articles_per_feed = 100 + no_stylesheets = True + encoding = 'cp1252' + use_embedded_content = False + language = 'en' + masthead_url = 'http://www.nst.com.my/Current_News/NST/Images/new-nstonline.jpg' + + conversion_options = { + 'comment' : description + , 'tags' : category + , 'publisher' : publisher + , 'language' : language + } + + remove_tags = [dict(name=['link','table'])] + keep_only_tags = dict(name='div',attrs={'id':'haidah'}) + + feeds = [(u'Articles', u'http://www.nst.com.my/rss/allSec')] + diff --git a/resources/recipes/readitlater.recipe b/resources/recipes/readitlater.recipe new file mode 100644 index 0000000000..4bd8fc2bd6 --- /dev/null +++ b/resources/recipes/readitlater.recipe @@ -0,0 +1,64 @@ +__license__ = 'GPL v3' +__copyright__ = '2010, Darko Miletic ' +''' +readitlaterlist.com +''' + +from calibre import strftime +from calibre.web.feeds.news import BasicNewsRecipe + +class Readitlater(BasicNewsRecipe): + title = 'Read It Later' + __author__ = 'Darko Miletic' + description = '''Personalized news feeds. Go to readitlaterlist.com to + setup up your news. Fill in your account + username, and optionally you can add password.''' + publisher = 'readitlater.com' + category = 'news, custom' + oldest_article = 7 + max_articles_per_feed = 100 + no_stylesheets = True + use_embedded_content = False + needs_subscription = True + INDEX = u'http://readitlaterlist.com' + LOGIN = INDEX + u'/l' + + + feeds = [(u'Unread articles' , INDEX + u'/unread')] + + def get_browser(self): + br = BasicNewsRecipe.get_browser() + if self.username is not None: + br.open(self.LOGIN) + br.select_form(nr=0) + br['feed_id'] = self.username + if self.password is not None: + br['password'] = self.password + br.submit() + return br + + def parse_index(self): + totalfeeds = [] + lfeeds = self.get_feeds() + for feedobj in lfeeds: + feedtitle, feedurl = feedobj + self.report_progress(0, _('Fetching feed')+' %s...'%(feedtitle if feedtitle else feedurl)) + articles = [] + soup = self.index_to_soup(feedurl) + ritem = soup.find('ul',attrs={'id':'list'}) + for item in ritem.findAll('li'): + description = '' + atag = item.find('a',attrs={'class':'text'}) + if atag and atag.has_key('href'): + url = self.INDEX + atag['href'] + title = self.tag_to_string(item.div) + date = strftime(self.timefmt) + articles.append({ + 'title' :title + ,'date' :date + ,'url' :url + ,'description':description + }) + totalfeeds.append((feedtitle, articles)) + return totalfeeds + diff --git a/resources/recipes/tidbits.recipe b/resources/recipes/tidbits.recipe new file mode 100644 index 0000000000..702c65e9e4 --- /dev/null +++ b/resources/recipes/tidbits.recipe @@ -0,0 +1,53 @@ + +__license__ = 'GPL v3' +__copyright__ = '2010, Darko Miletic ' +''' +db.tidbits.com +''' + +from calibre.web.feeds.news import BasicNewsRecipe + +class TidBITS(BasicNewsRecipe): + title = 'TidBITS: Mac News for the Rest of Us' + __author__ = 'Darko Miletic' + description = 'Insightful news, reviews, and analysis of the Macintosh and Internet worlds' + publisher = 'TidBITS Publishing Inc.' + category = 'news, Apple, Macintosh, IT, Internet' + oldest_article = 2 + max_articles_per_feed = 100 + no_stylesheets = True + encoding = 'utf-8' + use_embedded_content = True + language = 'en' + remove_empty_feeds = True + masthead_url = 'http://db.tidbits.com/images/tblogo9.gif' + extra_css = ' body{font-family: Georgia,"Times New Roman",Times,serif} ' + + conversion_options = { + 'comment' : description + , 'tags' : category + , 'publisher' : publisher + , 'language' : language + } + + remove_attributes = ['width','height'] + remove_tags = [dict(name='small')] + remove_tags_after = dict(name='small') + + feeds = [ + (u'Business Apps' , u'http://db.tidbits.com/feeds/business.rss' ) + ,(u'Entertainment' , u'http://db.tidbits.com/feeds/entertainment.rss') + ,(u'External Links' , u'http://db.tidbits.com/feeds/links.rss' ) + ,(u'Home Mac' , u'http://db.tidbits.com/feeds/home.rss' ) + ,(u'Inside TidBITS' , u'http://db.tidbits.com/feeds/inside.rss' ) + ,(u'iPod & iPhone' , u'http://db.tidbits.com/feeds/ipod-iphone.rss' ) + ,(u'Just for Fun' , u'http://db.tidbits.com/feeds/fun.rss' ) + ,(u'Macs & Mac OS X' , u'http://db.tidbits.com/feeds/macs.rss' ) + ,(u'Media Creation' , u'http://db.tidbits.com/feeds/creative.rss' ) + ,(u'Networking & Communications', u'http://db.tidbits.com/feeds/net.rss' ) + ,(u'Opinion & Editorial' , u'http://db.tidbits.com/feeds/opinion.rss' ) + ,(u'Support & Problem Solving' , u'http://db.tidbits.com/feeds/support.rss' ) + ,(u'Safe Computing' , u'http://db.tidbits.com/feeds/security.rss' ) + ,(u'Tech News' , u'http://db.tidbits.com/feeds/tech.rss' ) + ,(u'Software Watchlist' , u'http://db.tidbits.com/feeds/watchlist.rss' ) + ]