|
|
#1 |
|
Member
![]() Posts: 18
Karma: 10
Join Date: Nov 2014
Device: Kobo Mini
|
Hi
How can I do that my recipe change the title of each feed? For example, the original title of the feeds are: http://ganemosmadrid.info/category/a...minismos/feed/ 3er. ACTA REUNION GANEMOS FEMINISMOS MADRID 1er ACTA REUNIÓN-GANEMOS FEMINISMO_MADRID 4ª ACTA REUNION GANEMOS FENIMISMOS MADRID 2o. ACTA REUNIÓN GANEMOS FEMINISMO MADRID And I want to change it for: 3º Acta Ganemos Feminismos 1º Acta Ganemos Feminismos 4º Acta Ganemos Feminismos 2º Acta Ganemos Feminismos So I gues I need a function that get the original title to be able to check it with regular expressions, modification it and return the new title, but I don't find this function. Any help? Thanks |
|
|
|
|
|
#2 |
|
Member
![]() Posts: 18
Karma: 10
Join Date: Nov 2014
Device: Kobo Mini
|
Finally I do it work with:
Code:
def parse_feeds (self):
r = re.compile(u'^(\d+)(er\.?|o\.?|a\.|º|ª) (.*ACTA.*FE[MN]I[MN]ISMO.*)$', re.IGNORECASE|re.UNICODE)
feeds = BasicNewsRecipe.parse_feeds(self)
for f in feeds:
for a,c in enumerate(f.articles):
c.title=r.sub('\\1ª Acta Ganemos Feminismos',c.title)
return feeds
|
|
|
|
| Advert | |
|
|
![]() |
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Preventing Page Title from Being Inserted into Article Text | buffaloseven | Recipes | 0 | 07-26-2013 12:39 AM |
| KT -- complete rewrite? | tlc | Kindle Developer's Corner | 2 | 11-30-2011 11:29 AM |
| Can't extract article title in parse index | hiperlink | Recipes | 19 | 01-18-2011 12:00 PM |
| Article tweak for title sort not working | Manichean | Calibre | 2 | 10-04-2010 12:56 PM |