mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 10:14:46 -04:00
New recipe for MSDN Magazine by Darko Miletic
This commit is contained in:
parent
02363a7ae0
commit
77fc9f00fe
@ -199,7 +199,7 @@ class EmailAccounts(QAbstractTableModel):
|
||||
return (account, self.accounts[account])
|
||||
if role == Qt.ToolTipRole:
|
||||
return self.tooltips[col]
|
||||
if role == Qt.DisplayRole:
|
||||
if role in [Qt.DisplayRole, Qt.EditRole]:
|
||||
if col == 0:
|
||||
return QVariant(account)
|
||||
if col == 1:
|
||||
|
BIN
src/calibre/gui2/images/news/msdnmag_en.png
Normal file
BIN
src/calibre/gui2/images/news/msdnmag_en.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 694 B |
@ -38,7 +38,7 @@ recipe_modules = ['recipe_' + r for r in (
|
||||
'mondedurable', 'instapaper', 'dnevnik_cro', 'vecernji_list',
|
||||
'nacional_cro', '24sata', 'dnevni_avaz', 'glas_srpske', '24sata_rs',
|
||||
'krstarica', 'krstarica_en', 'tanjug', 'laprensa_ni', 'azstarnet',
|
||||
'corriere_della_sera_it', 'corriere_della_sera_en',
|
||||
'corriere_della_sera_it', 'corriere_della_sera_en', 'msdnmag_en',
|
||||
)]
|
||||
|
||||
import re, imp, inspect, time, os
|
||||
|
61
src/calibre/web/feeds/recipes/recipe_msdnmag_en.py
Normal file
61
src/calibre/web/feeds/recipes/recipe_msdnmag_en.py
Normal file
@ -0,0 +1,61 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
__license__ = 'GPL v3'
|
||||
__copyright__ = '2009, Darko Miletic <darko.miletic at gmail.com>'
|
||||
'''
|
||||
msdn.microsoft.com/en-us/magazine
|
||||
'''
|
||||
from calibre.web.feeds.news import BasicNewsRecipe
|
||||
|
||||
class MSDNMagazine_en(BasicNewsRecipe):
|
||||
title = 'MSDN Magazine'
|
||||
__author__ = 'Darko Miletic'
|
||||
description = 'The Microsoft Journal for Developers'
|
||||
publisher = 'Microsoft Press'
|
||||
category = 'news, IT, Microsoft, programming, windows'
|
||||
oldest_article = 31
|
||||
max_articles_per_feed = 100
|
||||
no_stylesheets = True
|
||||
use_embedded_content = False
|
||||
encoding = 'utf-8'
|
||||
remove_javascript = True
|
||||
current_issue = 'http://msdn.microsoft.com/en-us/magazine/default.aspx'
|
||||
language = _('English')
|
||||
|
||||
html2lrf_options = [
|
||||
'--comment', description
|
||||
, '--category', category
|
||||
, '--publisher', publisher
|
||||
]
|
||||
|
||||
html2epub_options = 'publisher="' + publisher + '"\ncomments="' + description + '"\ntags="' + category + '"'
|
||||
|
||||
feeds = [(u'Articles', u'http://msdn.microsoft.com/en-us/magazine/rss/default.aspx?z=z&iss=1')]
|
||||
|
||||
keep_only_tags = [dict(name='div', attrs={'class':'topic'})]
|
||||
|
||||
remove_tags = [
|
||||
dict(name=['object','link','base','table'])
|
||||
,dict(name='div', attrs={'class':'MTPS_CollapsibleRegion'})
|
||||
]
|
||||
|
||||
def get_cover_url(self):
|
||||
cover_url = None
|
||||
soup = self.index_to_soup(self.current_issue)
|
||||
link_item = soup.find('span',attrs={'class':'ContentsImageSpacer'})
|
||||
if link_item:
|
||||
imgt = link_item.find('img')
|
||||
if imgt:
|
||||
cover_url = imgt['src']
|
||||
return cover_url
|
||||
|
||||
|
||||
def preprocess_html(self, soup):
|
||||
for item in soup.findAll('div',attrs={'class':['FeatureSmallHead','ColumnTypeSubTitle']}):
|
||||
item.name="h2"
|
||||
for item in soup.findAll('div',attrs={'class':['FeatureHeadline','ColumnTypeTitle']}):
|
||||
item.name="h1"
|
||||
for item in soup.findAll('div',attrs={'class':'ArticleTypeTitle'}):
|
||||
item.name="h3"
|
||||
return soup
|
||||
|
Loading…
x
Reference in New Issue
Block a user