View Single Post
Old 06-17-2011, 10:51 AM   #3
sexymax15
Enthusiast
sexymax15 began at the beginning.
 
sexymax15's Avatar
 
Posts: 30
Karma: 12
Join Date: Jun 2011
Location: India
Device: Kindle 3g
Here's the recipe for Philadelphia Inquirrer(Philly.com).It works without any problems.

Spoiler:
Code:
import re

from calibre.web.feeds.news import BasicNewsRecipe
from calibre.ebooks.chardet import xml_to_unicode
class AdvancedUserRecipe1308312288(BasicNewsRecipe):
    title          = u'Philadelphia Inquirer(Philly.com)'
    oldest_article = 15
    max_articles_per_feed = 20
    use_embedded_content = False
    remove_empty_feeds = True
    no_stylesheets = True
    remove_javascript = True

   # remove_tags_before = {'class':'article_timestamp'}
    #remove_tags_after = {'class':'graylabel'}
    keep_only_tags= [dict(name=['h1','p'])]
    remove_tags = [dict(name=['hr','dl','dt','img','meta','iframe','link','script','form','input','label']),
dict(id=['toggleConfirmEmailDiv','toggleTOS','toggleUsernameMsgDiv','toggleConfirmYear','navT1_philly','secondaryNav','navPlacement','globalPrimaryNav'
,'ugc-footer-philly','bv_footer_include','footer','header',
'container_rag_bottom','section_rectangle','contentrightside'])
,{'class':['megamenu3 megamenu','container misc','container_inner misc_inner'
,'misccontainer_left_32','headlineonly','misccontainer_middle_32'
,'misccontainer_right_32','headline formBegin',
'post_balloon','relatedlist','linkssubhead','b_sq','dotted-rule-above'
,'container','headlines-digest','graylabel','container_inner'
,'rlinks_colorbar1','rlinks_colorbar2','supercontainer','container_5col_left','container_image_left',
'digest-headline2','digest-lead','container_5col_leftmiddle',
'container_5col_middlemiddle','container_5col_rightmiddle'
,'container_5col_right','divclear','supercontainer_outer force-width',
'supercontainer','containertitle  kicker-title',
'pollquestion','pollchoice','photomore','pollbutton','container rssbox','containertitle video ',
'containertitle_image ','container_tabtwo','selected'
,'shadetabs','selected','tabcontentstyle','tabcontent','inner_container'
,'arrow','container_ad','containertitlespacer','adUnit','tracking','sitemsg_911 clearfix']}]

    extra_css             = """ 
                               h1{font-family: Georgia,serif; font-size: xx-large} 
                               
                            """


    feeds          = [(u'News', u'http://www.philly.com/philly_news.rss')]
Screenshot:


Moderator Notice
Edited to add tags.
Attached Files
File Type: zip Philadelphia Inquirer(Philly.com)_1129.zip (1.2 KB, 210 views)

Last edited by Starson17; 06-17-2011 at 11:52 AM.
sexymax15 is offline   Reply With Quote