It may be unclear but I'll do my best. I'm currently using dashing, the dashboard designer (sinatra based) with the RSS widget. The thing is that I am unable to get the little image before each RSS item:
<description>
<img style='vertical-align:middle' src='http://pitre-web.tpg.ch/images?ligne=D' title='Perturbation Line D' alt='Perturbation Line D' />
<br/><br/>21:03 - THEME - Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
</description>
I know the code looks a bit strange but on the webpage all the stuff until 21:03 is ignored. How can I integrate the small logo to the page or at least get the line number (it's a bus line -> here it's D) in order to integrate in plain text in my widget? I don't know if that helps, but I am using nogokiri to fetch the XML from the RSS feed. So what could i put there to fetch this piece of information?
summary = clean_html( news_item.xpath('description').text )
Thanks in advance :)
The content of the
<description>
tag is HTML-encoded, so it needs to be decoded back to HTML, then reparsed:This is how to locate the tag:
To access its content use:
To do something with that content:
The real XML doesn't match what was given in the question. Here's a better example showing what is being encountered:
Based on that, here's code that works to extract the URLs: