Giter Site home page Giter Site logo

ping / newsrack Goto Github PK

View Code? Open in Web Editor NEW
13.0 13.0 8.0 2.05 MB

Generate a GitHub-hosted newsrack of magazines and newspapers for your Kindle/ereader

Home Page: https://ping.github.io/newsrack/

License: GNU General Public License v3.0

Shell 0.39% Python 88.60% HTML 1.05% JavaScript 5.18% SCSS 4.17% XSLT 0.61%
calibre ebook ebooks kindle

newsrack's People

Contributors

ping avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

newsrack's Issues

Help - Recipe generate mobi file but github actions hangs

#!/usr/bin/env  python

from calibre.web.feeds.news import BasicNewsRecipe, classes

_name = "Divya Bhaskar"

class divyabhaskar(BasicNewsRecipe):
    title = u'દિવ્ય ભાસ્કર'
    description = 'Divya Bhaskar is an Indian Gujarati-language daily newspaper owned by the Dainik Bhaskar Group. It is ranked 4th in the world by circulation and is the largest newspaper in India by circulation.'
    language = 'gu'
    __author__ = 'unkn0wn'
    oldest_article = 1  # days
    max_articles_per_feed = 50
    encoding = 'utf-8'
    use_embedded_content = False
    masthead_url = 'https://upload.wikimedia.org/wikipedia/commons/thumb/0/02/Divya_Bhaskar_%282019-11-01%29.svg/1920px-Divya_Bhaskar_%282019-11-01%29.svg.png'
    no_stylesheets = True
    remove_attributes = ['style', 'height', 'width']
    ignore_duplicate_articles = {'url'}
    compress_news_images = True
    compress_news_images_auto_size = 10
    scale_news_images = (800, 800)
    
    def get_cover_url(self):
        soup = self.index_to_soup('https://epaper.divyabhaskar.co.in/')
        tag = soup.find(attrs={'class': 'scaleDiv'})
        if tag:
            self.cover_url = tag.find('img')['src'].replace("_ss.jpg", "_l.jpg")
        return super().get_cover_url()

    keep_only_tags = [
        classes('f5afa1d3'),
    ]

    remove_tags = [
        classes('_3c197847 _66d97d7f e0d43c76 bhaskar-widget-container-class _28e65306 _8adadf19 _07c65a39'),
        dict(name='svg'),
    ]

    feeds = [ 
        ('Gujarat', 'https://www.divyabhaskar.co.in/rss-v1--category-1035.xml'),
        ('National', 'https://divyabhaskar.co.in/rss-v1--category-1037.xml'),
        ('DvB Original', 'https://divyabhaskar.co.in/rss-v1--category-11879.xml'),
        ('International', 'https://divyabhaskar.co.in/rss-v1--category-1038.xml'),
        ('Sports', 'https://divyabhaskar.co.in/rss-v1--category-970.xml'),
        ('Business', 'https://divyabhaskar.co.in/rss-v1--category-969.xml'),
        ('Lifestyle', 'https://divyabhaskar.co.in/rss-v1--category-5029.xml'),
        ('Utility', 'https://divyabhaskar.co.in/rss-v1--category-10695.xml'),
        ('Entertainment', 'https://divyabhaskar.co.in/rss-v1--category-12042.xml'),
        ]

calibre_most_common_ua = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.87 Safari/537.36'

Can you test this recipe? On local machine, it works perfectly.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.