mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 18:54:09 -04:00
New recipe for Physics Today by Hypernova
This commit is contained in:
parent
b6ab0ba4a0
commit
0709d5ec76
@ -30,7 +30,7 @@ recipe_modules = ['recipe_' + r for r in (
|
|||||||
'honoluluadvertiser', 'starbulletin', 'exiled', 'indy_star', 'dna',
|
'honoluluadvertiser', 'starbulletin', 'exiled', 'indy_star', 'dna',
|
||||||
'pobjeda', 'chicago_breaking_news', 'glasgow_herald', 'linuxdevices',
|
'pobjeda', 'chicago_breaking_news', 'glasgow_herald', 'linuxdevices',
|
||||||
'hindu', 'cincinnati_enquirer', 'physics_world', 'pressonline',
|
'hindu', 'cincinnati_enquirer', 'physics_world', 'pressonline',
|
||||||
'la_republica',
|
'la_republica', 'physics_today',
|
||||||
)]
|
)]
|
||||||
|
|
||||||
import re, imp, inspect, time, os
|
import re, imp, inspect, time, os
|
||||||
|
28
src/calibre/web/feeds/recipes/recipe_physics_today.py
Normal file
28
src/calibre/web/feeds/recipes/recipe_physics_today.py
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
import re
|
||||||
|
from calibre.web.feeds.recipes import BasicNewsRecipe
|
||||||
|
|
||||||
|
class Physicstoday(BasicNewsRecipe):
|
||||||
|
title = u'Physicstoday'
|
||||||
|
__author__ = 'Hypernova'
|
||||||
|
description = u'Physicstoday'
|
||||||
|
language = _('English')
|
||||||
|
oldest_article = 30
|
||||||
|
max_articles_per_feed = 100
|
||||||
|
no_stylesheets = True
|
||||||
|
use_embedded_content = False
|
||||||
|
needs_subscription = True
|
||||||
|
remove_javascript = True
|
||||||
|
remove_tags_before = dict(name='h1')
|
||||||
|
remove_tags_after = [dict(name='div', attrs={'id':'footer'})]
|
||||||
|
|
||||||
|
feeds = [(u'All', u'http://www.physicstoday.org/feed.xml')]
|
||||||
|
|
||||||
|
def get_browser(self):
|
||||||
|
br = BasicNewsRecipe.get_browser()
|
||||||
|
if self.username is not None and self.password is not None:
|
||||||
|
br.open('http://www.physicstoday.org/pt/sso_login.jsp')
|
||||||
|
br.select_form(name='login')
|
||||||
|
br['username'] = self.username
|
||||||
|
br['password'] = self.password
|
||||||
|
br.submit()
|
||||||
|
return br
|
Loading…
x
Reference in New Issue
Block a user