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 12-27-2014, 10:54 PM   #1
Jilfan
Junior Member
Jilfan began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Dec 2014
Device: Kindle Touch
Recipe for "The Pickering Post"

I am a newbie so please forgive my ignorance. /i have tried to get Calibre to download The Pickering Post (& a couple of other web sites that I follow.) using the basic recipe in add a custom news source. All I get is all the HTML source returned with the articles embedded. For the others i get just the cover or blank pages. Clearly I have lot to learn. Could someone help me get started on the best way to approach this. The Pickering Post website is at:

http://pickeringpost.com/ with first few articles at:

http://pickeringpost.com/story/most-...ti-muslim/4331
http://pickeringpost.com/story/2014-...ty-awards/4323
http://pickeringpost.com/story/a-ter...ver-xmas-/4317

This is a free subscription site.

Any help would be appreciated.
Thanks.
Jilfan is offline   Reply With Quote
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
Advert
Old 01-19-2015, 01:25 AM   #3
Jilfan
Junior Member
Jilfan began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Dec 2014
Device: Kindle Touch
Thank you very much. It returns about 5 or 6 articles but does not always work constantly. I have noticed that manually logging in to the web site sometimes has no content but if I actually log in with my user name and pw then the articles show.

Does this mean that I will need to add code with my username and pw in the script?

Do you have an example I can add? thanks.
Jilfan is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Recipe for EPUB subscribers of "Tagesspiegel" and "Handelsblatt"? F.W. Recipes 0 05-14-2013 11:16 AM
New recipe for "Süddeutsche Zeitung" using "E-Paper mobile" subscription Ernst Recipes 3 02-16-2013 07:37 AM
Recipe for "Galicia Confidencial" and "De L a V" roebek Recipes 1 07-19-2011 09:17 AM


All times are GMT -4. The time now is 09:28 AM.


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