| 1 |
# -*- coding: utf-8 -*- |
| 2 |
from calibre.web.feeds import Feed |
| 3 |
from calibre.web.feeds.news import BasicNewsRecipe |
| 4 |
|
| 5 |
|
| 6 |
class GC_gl(BasicNewsRecipe): |
| 7 |
title = 'Galicia Confidencial (RSS)' |
| 8 |
__author__ = 'Susana Sotelo Docío' |
| 9 |
description = 'Unha fiestra de información aberta a todos' |
| 10 |
publisher = 'Galicia Confidencial' |
| 11 |
category = 'news, society, politics, Galicia' |
| 12 |
encoding = 'utf-8' |
| 13 |
language = 'gl' |
| 14 |
direction = 'ltr' |
| 15 |
cover_url = 'http://galiciaconfidencial.com/imagenes/header/logo_gc.gif' |
| 16 |
oldest_article = 5 |
| 17 |
max_articles_per_feed = 100 |
| 18 |
center_navbar = False |
| 19 |
|
| 20 |
feeds = [('Novas no RSS', 'http://galiciaconfidencial.com/rss2/xeral.rss')] |
| 21 |
|
| 22 |
extra_css = ' p{text-align:left} ' |
| 23 |
|
| 24 |
def print_version(self, url): |
| 25 |
return url.replace('http://galiciaconfidencial.com/nova/', 'http://galiciaconfidencial.com/imprimir/') |
| 26 |
|
| 27 |
def parse_index(self): |
| 28 |
feeds = [] |
| 29 |
self.gc_parse_feeds(feeds) |
| 30 |
return feeds |
| 31 |
|
| 32 |
def gc_parse_feeds(self, feeds): |
| 33 |
rssFeeds = Feed() |
| 34 |
rssFeeds = BasicNewsRecipe.parse_feeds(self) |
| 35 |
self.feed_to_index_append(rssFeeds[:], feeds) |
| 36 |
|
| 37 |
def feed_to_index_append(self, feedObject, masterFeed): |
| 38 |
for feed in feedObject: |
| 39 |
newArticles = [] |
| 40 |
for article in feed.articles: |
| 41 |
newArt = {'title': article.title, 'url': article.url, 'date': article.date} |
| 42 |
newArticles.append(newArt) |
| 43 |
masterFeed.append((feed.title, newArticles)) |