View Single Post
Old 01-10-2015, 06:39 AM   #2
Krittika Goyal
Vox calibre
Krittika Goyal ought to be getting tired of karma fortunes by now.Krittika Goyal ought to be getting tired of karma fortunes by now.Krittika Goyal ought to be getting tired of karma fortunes by now.Krittika Goyal ought to be getting tired of karma fortunes by now.Krittika Goyal ought to be getting tired of karma fortunes by now.Krittika Goyal ought to be getting tired of karma fortunes by now.Krittika Goyal ought to be getting tired of karma fortunes by now.Krittika Goyal ought to be getting tired of karma fortunes by now.Krittika Goyal ought to be getting tired of karma fortunes by now.Krittika Goyal ought to be getting tired of karma fortunes by now.Krittika Goyal ought to be getting tired of karma fortunes by now.
 
Krittika Goyal's Avatar
 
Posts: 412
Karma: 1175230
Join Date: Jan 2009
Device: Sony reader prs700, kobo
Here is something to start with:
Code:
from calibre.web.feeds.news import BasicNewsRecipe

class NewYorkTimesBookReview(BasicNewsRecipe):
    title          = u'The Pickering Post'
    language       = 'en'
    description    = ''
    __author__     = 'Krittika Goyal'


    no_stylesheets = True
    no_javascript = True
    auto_cleanup = True


    def parse_index(self):
        soup = self.index_to_soup('http://pickeringpost.com/')

        # Find TOC
        toc = soup.find('div', id='articles')
        feeds = []
        articles = []
        section_title = 'News'
        for x in toc.findAll(['a'], attrs={'class':['timeline-article bf']}):
            tt = x.find('h2')
            title = self.tag_to_string(tt)
            url = 'http://pickeringpost.com' + x['href']
            self.log('\tFound article:', title, url)
            articles.append({'title':title, 'url':url})
            
        return [('Articles', articles)]
Krittika Goyal is offline   Reply With Quote