Google Alert Daily Digest as RSS

671 Views Asked by At

We can use Google to make alerts for us. I have made some 10 alerts, and because I was "spammed" with messages, I used the "Daily Digest" option; I now get every day in the morning a single message with all the alerts. Note that the separate alerts have the option to convert the alert to an RSS feed, but not the combined one.

However, I really do not like how this email is structured, and I'd much prefer to somehow see this as an RSS that I can read with some RSS reader.

I tried using Python to collect the email, and have used lxml and bs4 to parse it, but it is so incredibly messy and inconsistent to parse.

Does anyone know of a way to create a nice rss feed out of it (title, body, link)?

I'm able to extract the html from the email, here is a simple to work with html for those interested.

sp = BeautifulSoup('path/to/html')
for span in sp.findAll('span'):
    link = span.find('a')
    if link is not None and hasattr(link, 'href'):
        print(link.text)

It gets me 22 link texts, even though I have 17 posts.

The problem is that even the links and text are not consistently placed.

This is as close as I got with lxml.html:

tr = lxml.html.fromstring('path/to/html')
links = tr.xpath('//table/tr/td/div/span/a')

len(links) == 16    # not 17
True
1

There are 1 best solutions below

0
On

Create the alert first. You can then choose your method of delivery by dropping down the 'Deliver to' box. There are two options to choose from - email or RSS feed.