mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 18:24:30 -04:00
Sync to trunk.
This commit is contained in:
commit
718a2346ac
43
recipes/idg_now.recipe
Normal file
43
recipes/idg_now.recipe
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
from calibre.web.feeds.news import BasicNewsRecipe
|
||||||
|
|
||||||
|
class IDGNow(BasicNewsRecipe):
|
||||||
|
title = 'IDG Now!'
|
||||||
|
__author__ = 'Diniz Bortolotto'
|
||||||
|
description = 'Posts do IDG Now!'
|
||||||
|
oldest_article = 7
|
||||||
|
max_articles_per_feed = 20
|
||||||
|
encoding = 'utf8'
|
||||||
|
publisher = 'Now!Digital Business Ltda.'
|
||||||
|
category = 'technology, telecom, IT, Brazil'
|
||||||
|
language = 'pt_BR'
|
||||||
|
publication_type = 'technology portal'
|
||||||
|
use_embedded_content = False
|
||||||
|
extra_css = '.headline {font-size: x-large;} \n .fact { padding-top: 10pt }'
|
||||||
|
|
||||||
|
def get_article_url(self, article):
|
||||||
|
link = article.get('link', None)
|
||||||
|
if link is None:
|
||||||
|
return article
|
||||||
|
if link.split('/')[-1]=="story01.htm":
|
||||||
|
link=link.split('/')[-2]
|
||||||
|
a=['0B','0C','0D','0E','0F','0G','0I','0N' ,'0L0S','0A','0J3A']
|
||||||
|
b=['.' ,'/' ,'?' ,'-' ,'=' ,'&' ,'_','.com','www.','0',':']
|
||||||
|
for i in range(0,len(a)):
|
||||||
|
link=link.replace(a[i],b[i])
|
||||||
|
link=link.split('&')[-3]
|
||||||
|
link=link.split('=')[1]
|
||||||
|
link=link + "/IDGNoticiaPrint_view"
|
||||||
|
return link
|
||||||
|
|
||||||
|
feeds = [
|
||||||
|
(u'Ultimas noticias', u'http://rss.idgnow.com.br/c/32184/f/499640/index.rss'),
|
||||||
|
(u'Computa\xe7\xe3o Corporativa', u'http://rss.idgnow.com.br/c/32184/f/499643/index.rss'),
|
||||||
|
(u'Carreira', u'http://rss.idgnow.com.br/c/32184/f/499644/index.rss'),
|
||||||
|
(u'Computa\xe7\xe3o Pessoal', u'http://rss.idgnow.com.br/c/32184/f/499645/index.rss'),
|
||||||
|
(u'Internet', u'http://rss.idgnow.com.br/c/32184/f/499646/index.rss'),
|
||||||
|
(u'Mercado', u'http://rss.idgnow.com.br/c/32184/f/419982/index.rss'),
|
||||||
|
(u'Seguran\xe7a', u'http://rss.idgnow.com.br/c/32184/f/499647/index.rss'),
|
||||||
|
(u'Telecom e Redes', u'http://rss.idgnow.com.br/c/32184/f/499648/index.rss')
|
||||||
|
]
|
||||||
|
|
||||||
|
reverse_article_order = True
|
@ -227,7 +227,9 @@ class KOBO(USBMS):
|
|||||||
try:
|
try:
|
||||||
cursor.execute (query)
|
cursor.execute (query)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
if '___ExpirationStatus' not in str(e):
|
err = str(e)
|
||||||
|
if not ('___ExpirationStatus' in err or 'FavouritesIndex' in err or
|
||||||
|
'Accessibility' in err):
|
||||||
raise
|
raise
|
||||||
query= ('select Title, Attribution, DateCreated, ContentID, MimeType, ContentType, '
|
query= ('select Title, Attribution, DateCreated, ContentID, MimeType, ContentType, '
|
||||||
'ImageID, ReadStatus, "-1" as ___ExpirationStatus, "-1" as '
|
'ImageID, ReadStatus, "-1" as ___ExpirationStatus, "-1" as '
|
||||||
|
Loading…
x
Reference in New Issue
Block a user