Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre > Recipes

Notices

Reply
 
Thread Tools Search this Thread
Old 05-12-2012, 07:15 AM   #1
adoucette
Member
adoucette doesn't litteradoucette doesn't litter
 
Posts: 24
Karma: 140
Join Date: Sep 2011
Device: Nook Color (rooted?)
Stars and Stripes

Here's a recipe for the english language military news paper "Stars and Stripes"

Code:
''' Stars and Stripes
 '''
 

 import string, re
 from calibre import strftime
 from calibre.web.feeds.recipes import BasicNewsRecipe
 from calibre.ebooks.BeautifulSoup import BeautifulSoup
 

 class AdvancedUserRecipe1308791026(BasicNewsRecipe):
     title          = u'Stars and Stripes'
     oldest_article = 3
     max_articles_per_feed = 100
     __author__             = 'me'
     description            = 'The U.S. militarys independent news source, featuring exclusive reports from Iraq, Afghanistan, Europe and the Far East.'
     no_stylesheets         = True
     #delay                  = 1
     use_embedded_content   = False
     encoding               = 'utf8'
     publisher              = 'stripes.com'
     category               = 'news, US, world'
     language               = 'en_US'
     publication_type       = 'newsportal'
     preprocess_regexps     = [(re.compile(r'<!--.*?-->', re.DOTALL), lambda m: '')]
     conversion_options = {
         'comments'        : description
         ,'tags'            : category
         ,'language'        : language
         ,'publisher'       : publisher
         ,'linearize_tables': True
         }
     keep_only_tags    = [dict(name='div', attrs={'class':['element article']})]
     remove_tags_after = [dict(name='ul', attrs={'class':'inline-bookmarks'})]
     feeds          = [(u'News', u'http://feeds.stripes.com/starsandstripes/news'), (u'Sports', u'http://feeds.stripes.com/starsandstripes/sports'), (u'Military Life', u'http://feeds.stripes.com/starsandstripes/militarylife'), (u'Opinion', u'http://feeds.stripes.com/starsandstripes/opinion'), (u'Travel', u'http://feeds.stripes.com/starsandstripes/travel')]
adoucette is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Vertical Stripes on Hanvon n518 Wisereader pant90 More E-Book Readers 1 11-18-2011 11:24 AM
Cool-er grey stripes, won't respond. purplecaz Interead COOL-ER 4 06-11-2011 05:08 AM
Sat on reader (by mistake duh) and now its full of black and gray stripes. Pony Sony Reader 4 08-11-2010 05:42 PM
Display shows only stripes! Please help! Chrikow Bookeen 27 10-17-2009 06:09 AM
How often are the "hated" stripes on iLiad? IMG iRex 4 12-31-2008 10:16 AM


All times are GMT -4. The time now is 07:42 PM.


MobileRead.com is a privately owned, operated and funded community.