Register Guidelines E-Books Today's Posts Search

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

Notices

Reply
 
Thread Tools Search this Thread
Old 07-05-2012, 01:46 PM   #1
_reader
Member
_reader doesn't litter_reader doesn't litter
 
Posts: 24
Karma: 142
Join Date: Sep 2010
Device: K3, KPW
New Recipe - The CATO Institute

The Cato Institute is a public policy research organization — a think tank — dedicated to the principles of individual liberty, limited government, free markets and peace. Its scholars and analysts conduct independent, nonpartisan research on a wide range of policy issues.

Recipe submitted for review / comments / inclusion.

Spoiler:
Code:
from calibre.web.feeds.news import BasicNewsRecipe
class CATOInstitute(BasicNewsRecipe):
    title          		= u'The CATO Institute'
    custom_title 	= "The CATO Institute"
    #custom_title 	= "The CATO Institute - " + time.strftime('%d %b %Y %I:%M %p')
    description      	= "The Cato Institute is a public policy research organization — a think tank — \
dedicated to the principles of individual liberty, limited government, free markets and peace.\
 Its scholars and analysts conduct independent, nonpartisan research on a wide range of policy issues."
    __author__     	= '_reader'
    __date__                	= '05 July 2012'
    __version__            	 = '1.0'
    cover_url        	= 'http://www.cato.org/images/logo.jpg'
    masthead_url        	= 'http://www.cato.org/images/logo.jpg' 
    language        	= 'en'
    oldest_article 	= 30 #days
    max_articles_per_feed 	= 100
    needs_subscription 	= False
    publisher             	= 'CATO Institute'
    category              	= 'commentary'
    tags 		= 'commentary'
    publication_type 	= 'blog'
    no_stylesheets         	= True
    use_embedded_content  = False
    encoding        	= None
    simultaneous_downloads = 10
    recursions      	= 0
    remove_javascript 	= True
    remove_empty_feeds    	= True
    auto_cleanup 	= True

    conversion_options = { 'title'   : custom_title,
                           'comments'    : description,
                           'tags'             : tags,
                           'language'      : language,
                           'publisher'      : publisher,
                           'authors'        : publisher,
                           'smarten_punctuation' : True
                            }


    feeds          = [
	(u'Cato Recent Op-Eds', u'http://feeds.cato.org/CatoRecentOpeds'), 
	(u'Cato Homepage Headlines', u'http://feeds.cato.org/CatoHomepageHeadlines'), 
	(u'Cato Media Updates', u'http://feeds.cato.org/CatoMediaUpdates'), 
	(u'Cato@Liberty', u'http://feeds.cato.org/Cato-at-liberty'), 
	(u'Cato Unbound', u'http://feeds.feedburner.com/cato-unbound'), 
	(u'Education and Child Policy', u'http://www.cato.org/rss/ra.xml?name=education-child-policy'), 
	(u'Finance, Banking & Monetary Policy', u'http://www.cato.org/rss/ra.xml?name=finance-banking-monetary-policy'), 
	(u'Government and Politics', u'http://www.cato.org/rss/ra.xml?name=government-politics'), 
	(u'International Economics & Development', u'http://www.cato.org/rss/ra.xml?name=international-economics-development'), 
	(u'Political Philosophy', u'http://www.cato.org/rss/ra.xml?name=political-philosophy'), 
	(u'Social Security', u'http://www.cato.org/rss/ra.xml?name=social-security'), 
	(u'Telecom, Internet & Information Policy', u'http://www.cato.org/rss/ra.xml?name=telecom-internet-information-policy'), 
	(u'Energy and Environment', u'http://www.cato.org/rss/ra.xml?name=energy-environment'), 
	(u'Foreign Policy and National Security', u'http://www.cato.org/rss/ra.xml?name=foreign-policy-national-security'), 
	(u'Health Care', u'http://www.cato.org/rss/ra.xml?name=health-care'), 
	(u'Law and Civil Liberties', u'http://www.cato.org/rss/ra.xml?name=law-civil-liberties'), 
	(u'Regulatory Studies', u'http://www.cato.org/rss/ra.xml?name=regulatory-studies'), 
	(u'Tax and Budget Policy', u'http://www.cato.org/rss/ra.xml?name=tax-budget-policy'), 
	(u'Trade and Immigration', u'http://www.cato.org/rss/ra.xml?name=trade-immigration')
	]




    def print_version(self,url):
          R_unbound = re.compile(r'(^.*cato-unbound.*)(\/\?utm_source.*$)' , re.DOTALL | re.IGNORECASE )     #CATO Unbound
          R_pubs       = re.compile(r'(^.*\/publications\/.*$)' , re.DOTALL | re.IGNORECASE )                              #CATO Publications
          if re.match(R_unbound, url):
             printURL = r'\g<1>' + '/print/'
          elif re.match(R_pubs, url):
             printURL = url + '?print'
          else:
             printURL = url + '/print/'
          return printURL

Last edited by _reader; 07-05-2012 at 02:17 PM. Reason: updated oldest_article
_reader is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
series similar to Simon Scarrow's Cato/Macro Eagle books for my son... sufue Reading Recommendations 10 09-29-2015 01:29 AM
Recipe works when mocked up as Python file, fails when converted to Recipe ode Recipes 7 09-04-2011 04:57 AM
Need Help with Recipe UtahJames Recipes 1 04-12-2011 09:50 AM
Royal national institute for the blind praise iPads abilty to 'read; books out... stustaff News 4 06-02-2010 10:04 AM
von Mises Institute eBook collection mjh215 Deals and Resources (No Self-Promotion or Affiliate Links) 2 04-30-2008 10:09 AM


All times are GMT -4. The time now is 05:15 PM.


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