This commit is contained in:
Kovid Goyal 2023-05-06 09:00:26 +05:30
commit 6d37f6f21e
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
3 changed files with 3 additions and 49 deletions

View File

@ -1,45 +0,0 @@
from calibre.web.feeds.news import BasicNewsRecipe
class ChowkRecipe(BasicNewsRecipe):
__license__ = 'GPL v3'
__author__ = 'kwetal'
language = 'en_IN'
version = 1
title = u'Chowk'
publisher = u'chowk.com'
category = u'Opinion, South Asia'
description = u'Ideas & Identities of South Asia'
use_embedded_content = False
remove_empty_feeds = True
oldest_article = 30
max_articles_per_feed = 100
remove_javascript = True
encoding = 'utf-8'
feeds = []
feeds.append(('Chowk Articles', 'http://www.chowk.com/rss'))
keep_only_tags = []
keep_only_tags.append(dict(name='div', attrs={'id': 'content'}))
conversion_options = {'comments': description, 'tags': category, 'language': 'en',
'publisher': publisher}
extra_css = '''
body{font-family:verdana,arial,helvetica,geneva,sans-serif;}
a {text-decoration: none; color: blue;}
div.pgtitle {font-size: x-large; font-weight: bold;}
div.wname, div.date {font-size: x-small; color: #696969;}
div.wname {margin-top: 1em;}
div.date {margin-bottom: 1em;}
div.title {font-weight: bold;}
'''
def print_version(self, url):
main, sep, id = url.rpartition('/')
return main + '/print/' + id

View File

@ -15,6 +15,7 @@ class IrishIndependent(BasicNewsRecipe):
oldest_article = 2 oldest_article = 2
max_articles_per_feed = 100 max_articles_per_feed = 100
no_stylesheets = True no_stylesheets = True
ignore_duplicate_articles = {'url'}
keep_only_tags = [ keep_only_tags = [
dict(name='div', attrs={'class':lambda x: x and '_contentwrapper' in x}) dict(name='div', attrs={'class':lambda x: x and '_contentwrapper' in x})
@ -26,7 +27,6 @@ class IrishIndependent(BasicNewsRecipe):
feeds = [ feeds = [
('Frontpage News', 'http://www.independent.ie/rss'), ('Frontpage News', 'http://www.independent.ie/rss'),
('News', 'http://www.independent.ie/rss'),
('World News', 'http://www.independent.ie/world-news/rss'), ('World News', 'http://www.independent.ie/world-news/rss'),
('Opinion', 'http://www.independent.ie/opinion/rss'), ('Opinion', 'http://www.independent.ie/opinion/rss'),
('Business', 'http://www.independent.ie/business/rss'), ('Business', 'http://www.independent.ie/business/rss'),

View File

@ -32,12 +32,11 @@ class IrishTimes(BasicNewsRecipe):
no_stylesheets = True no_stylesheets = True
temp_files = [] temp_files = []
keep_only_tags = [ keep_only_tags = [
dict(name=['h1', 'h2']), classes('custom-headline custom-subheadline lead-art-wrapper article-body-wrapper byline-text'),
classes('lead-art-wrapper article-body-wrapper byline-text'),
] ]
remove_tags = [ remove_tags = [
dict(name='button'), dict(name='button'),
classes('sm-promo-headline top-table-list-container'), classes('sm-promo-headline top-table-list-container single-divider interstitial-link'),
] ]
remove_attributes = ['width', 'height'] remove_attributes = ['width', 'height']