Runs: Every morning

Get a morning email with the news you actually read

Pick a few sites and get one tidy email each morning with their newest headlines, instead of opening ten tabs.

A digest beats a feed reader for people who never open the feed reader. One email, read with breakfast, and the tabs stay closed.

  1. Collect the feed addresses

    Most news sites and blogs publish an RSS feed. Try adding /feed or /rss to the site's address, or search for "site name RSS". Write down 3 to 8 feed addresses.

  2. Start a new script

    Go to script.google.com, click New project and name it Morning digest.

  3. Paste the script

    Replace the editor's contents with this and put your feed addresses in the list:

    const FEEDS = [
      'https://example.com/feed',
    ];
    const PER_FEED = 5;
    
    function sendDigest() {
      let html = '';
      for (const url of FEEDS) {
        const xml = XmlService.parse(UrlFetchApp.fetch(url).getContentText());
        const root = xml.getRootElement();
        const channel = root.getChild('channel');
        const items = channel ? channel.getChildren('item') : [];
        html += '<h3>' + (channel ? channel.getChildText('title') : url) + '</h3><ul>';
        for (const item of items.slice(0, PER_FEED)) {
          html += '<li><a href="' + item.getChildText('link') + '">' + item.getChildText('title') + '</a></li>';
        }
        html += '</ul>';
      }
      MailApp.sendEmail({
        to: Session.getActiveUser().getEmail(),
        subject: 'Your morning digest',
        htmlBody: html,
      });
    }
    
  4. Run it once

    Click Run and allow access. A digest email should arrive within a minute.

  5. Schedule it for the morning

    Open Triggers, click Add trigger, choose sendDigest, Time-driven, Day timer, and pick a time such as 7 to 8 am.

Things that trip people up

  • The simple by-hand script only reads RSS feeds. Sites that only offer Atom feeds need the agent version.
  • Some sites block automated requests; if one feed keeps failing, drop it or look for another feed address.