A stylized bird with an open mouth, tweeting.
The UK government warns Trump that war with Iran 'is in none of our interests' Adam Bienkov 2020-01-03T10:33:25Z The letter F. An envelope. It indicates the ability to send an email. An image of a chain link. It symobilizes a website link url. A stylized bird with an open mouth, tweeting. The word "in". A stylized letter F. Three evenly spaced dots forming an ellipsis: "...". Two crossed lines that form an 'X'. It indicates a way to close an interaction, or dismiss a notification. Donald Trump Boris Johnson Donald Trump Boris Johnson [5e0f163885] Donald Trump and Boris Johnson. Getty
The parts that stuck out to me were:
- The letter F.
- An envelope. It indicates the ability to send an email.
- An image of a chain link. It symobilizes a website link url.
And so on. What are these things anyway? Looking at the source of the page, I saw it has a bunch of icons which are also hyperlinks. The icon class contains a non-standard HTML tag <desc> which contains a description of the icon (perhaps in a gesture of accessibility toward people with vision impairment). The icon block looks something like this:
<a href="https://www.facebook.com"> <svg class="svg-icon facebook-icon"> <title id="title">Facebook Icon</title> <desc id="desc">The letter F.</desc> </svg> </a>
The body of the <desc> element get dumped into the visible text in the w3m browser. I wrote a little Python script to extract these descriptions.
import re with open('news_article.html', 'r') as f: article = f.read() snippets = re.findall(r'<desc id="desc">(.*)<\/desc>', article) with open('snippets.txt', 'w') as f: f.write('\n'.join(snippets))
Finally, here are all these little snippets standing alone, with the article and other junk stripped out. Read together, they have some majesty.
|||Bienkov, Adam. "The UK government warns Trump that war with Iran 'is in none of our interests'." Business Insider, 3 Jan. 2020, https://www.businessinsider.com/uk-warns-donald-trump-against-launching-war-iran-qassem-soleimani-2020-1. Accessed 13 March 2020.|