View Single Post
Old 06-13-2010, 07:47 AM   #2093
lordvetinari2
Zealot
lordvetinari2 is on a distinguished road
 
Posts: 137
Karma: 61
Join Date: Jun 2006
Location: Gijón, Spain
Device: Kindle 3G+WiFi & Galaxy Note
Hello,

I am trying to create a new recipe for Publico PT, because the bundled one does not work any more. I tried fixing it, but there was a regexp there that I do not understand. So I tried creating my own from scratch, and it mostly works, but I have a few problems.

The main problem is that certain parts of the website work differently, for some reason. Now, my recipe is checking for certain tags to remove unnecessary items (menus, icons, etc), and not every section uses the same tags. For instance, "http://economia.publico.pt/Noticia/g...e-2013_1441633" has the main article inside a div id="content", but the article "http://desporto.publico.pt/noticia.aspx?id=1441651" has a the main article inside a div class="containerMain". As my recipe stands now, when it does not find the tag defined under "keep_only_tags", it just returns an empty page. Is there any way to say, "check for this tag and if it's not there, check for the other one instead"?

I tried using the print_version method, but another problem is that not every article from the RSS feed has the same URI structure. As you can see in the example above, sometimes they use the full title for the URI and sometimes they use a number reference. Additionally, the print ("Imprimir" in Portuguese) mechanism for article URIs such as "http://desporto.publico.pt/noticia.aspx?id=1441651", fails miserably in the browser, while the one for "http://economia.publico.pt/Noticia/g...e-2013_1441633" just prints the current URI as it is displayed, without getting rid of unnecessary formatting.

Please find attached a calibre log and the recipe as it currently stands. If an operator gives me permission, I can also upload the epub file with the daily news as retrieved with my recipe.

I hope I can get some insight on this. Thanks in advance!
Attached Files
File Type: zip calibre_log--publico_recipe.zip (17.9 KB, 276 views)
lordvetinari2 is offline