Commit Graph

268 Commits

Author SHA1 Message Date
Leandro Facchinetti 665d09214c 2021-03-12 10:10:53 +00:00
Leandro Facchinetti d75e47bf5a 2021-03-12 10:06:07 +00:00
Leandro Facchinetti 9b397e299f 2021-03-12 10:02:51 +00:00
Leandro Facchinetti 7bb96b2b86 2021-03-12 10:02:31 +00:00
Leandro Facchinetti aa2b35f54b 2021-03-12 09:11:16 +00:00
Leandro Facchinetti 6cb6eba93f 2021-03-12 09:01:51 +00:00
Leandro Facchinetti 47bb8d9a97 2021-03-12 08:59:57 +00:00
Leandro Facchinetti 52998ba443 2021-03-11 22:12:37 +00:00
Leandro Facchinetti dc22ea9d74 2021-03-11 21:52:54 +00:00
Leandro Facchinetti 1c9bcb750f 2021-03-11 11:25:13 +00:00
Leandro Facchinetti 5525d199da 2021-03-11 11:22:54 +00:00
Leandro Facchinetti 002be23176 2021-03-11 11:19:50 +00:00
Leandro Facchinetti c2034b0a6b 2021-03-11 11:19:23 +00:00
Leandro Facchinetti cb0b836d92 2021-03-11 10:33:19 +00:00
Leandro Facchinetti 0793f31b4f 2021-03-11 10:29:05 +00:00
Leandro Facchinetti bfc2d126fb 2021-03-11 10:23:37 +00:00
Leandro Facchinetti 171450bf39 2021-03-11 10:08:51 +00:00
Leandro Facchinetti 3415a2d404 2021-03-11 10:04:09 +00:00
Leandro Facchinetti 4e488ca0bb 2021-03-11 08:49:25 +00:00
Leandro Facchinetti e3179f4cde 2021-03-10 21:33:43 +00:00
Leandro Facchinetti 113db29bdc 2021-03-10 14:04:09 +00:00
Leandro Facchinetti 5df7656559 2021-03-10 11:35:48 +00:00
Leandro Facchinetti 319838f7b3 2021-03-10 11:05:04 +00:00
Leandro Facchinetti c051b786df 2021-03-10 10:30:08 +00:00
Leandro Facchinetti 6f7f1ffe3d 2021-03-09 22:04:05 +00:00
Leandro Facchinetti 8bc4034fcc 2021-01-29 16:15:30 +00:00
Leandro Facchinetti 9177b417bf 2021-01-29 16:06:33 +00:00
Leandro Facchinetti 18606987b9 2021-01-29 15:14:40 +00:00
Leandro Facchinetti f3aab0c7e3 2021-01-21 16:35:47 +00:00
Leandro Facchinetti 63669faa42 2021-01-21 15:56:10 +00:00
Leandro Facchinetti ff1101adb7
Merge pull request #35 from leafac/dependabot/npm_and_yarn/axios-0.21.1
Bump axios from 0.19.2 to 0.21.1
2021-01-06 11:46:57 +00:00
dependabot[bot] 03cc6d73d6
Bump axios from 0.19.2 to 0.21.1
Bumps [axios](https://github.com/axios/axios) from 0.19.2 to 0.21.1.
- [Release notes](https://github.com/axios/axios/releases)
- [Changelog](https://github.com/axios/axios/blob/v0.21.1/CHANGELOG.md)
- [Commits](https://github.com/axios/axios/compare/v0.19.2...v0.21.1)

Signed-off-by: dependabot[bot] <support@github.com>
2021-01-05 22:31:46 +00:00
Leandro Facchinetti 2d16deb1a8 . 2021-01-05 18:58:17 +00:00
Leandro Facchinetti d64dceaf94 . 2021-01-01 18:46:25 +00:00
Leandro Facchinetti 424721b98c Close https://github.com/leafac/kill-the-newsletter.com/issues/33 2020-12-22 20:50:37 +00:00
Leandro Facchinetti 08ca42693b . 2020-12-22 20:31:27 +00:00
Leandro Facchinetti 574c1cff3e . 2020-12-22 20:00:32 +00:00
Leandro Facchinetti 93b99aa113 Fix https://github.com/leafac/kill-the-newsletter.com/issues/34 2020-12-22 19:43:17 +00:00
Leandro Facchinetti 6de1da51fe . 2020-12-22 19:34:02 +00:00
Leandro Facchinetti 942b8c309c Merge branch 'master' of github.com:leafac/www.kill-the-newsletter.com 2020-12-17 17:24:14 +00:00
Leandro Facchinetti 0b7f488c17 . 2020-12-17 17:24:10 +00:00
Leandro Facchinetti 1dd2ed5e64
Merge pull request #32 from leafac/dependabot/npm_and_yarn/ini-1.3.8
Bump ini from 1.3.5 to 1.3.8
2020-12-12 02:40:10 +00:00
dependabot[bot] 3f3dc8d46e
Bump ini from 1.3.5 to 1.3.8
Bumps [ini](https://github.com/isaacs/ini) from 1.3.5 to 1.3.8.
- [Release notes](https://github.com/isaacs/ini/releases)
- [Commits](https://github.com/isaacs/ini/compare/v1.3.5...v1.3.8)

Signed-off-by: dependabot[bot] <support@github.com>
2020-12-12 02:38:25 +00:00
Leandro Facchinetti cb0bf74025 . 2020-12-12 02:37:21 +00:00
Leandro Facchinetti 640fbef200 Close #31 2020-12-07 22:56:00 +00:00
Leandro Facchinetti ab543e302a
Merge pull request #29 from leafac/dependabot/npm_and_yarn/systeminformation-4.30.6
Bump systeminformation from 4.27.11 to 4.30.6
2020-11-27 16:43:13 +00:00
dependabot[bot] 13d41257c5
Bump systeminformation from 4.27.11 to 4.30.6
Bumps [systeminformation](https://github.com/sebhildebrandt/systeminformation) from 4.27.11 to 4.30.6.
- [Release notes](https://github.com/sebhildebrandt/systeminformation/releases)
- [Changelog](https://github.com/sebhildebrandt/systeminformation/blob/master/CHANGELOG.md)
- [Commits](https://github.com/sebhildebrandt/systeminformation/commits)

Signed-off-by: dependabot[bot] <support@github.com>
2020-11-27 16:27:03 +00:00
Leandro Facchinetti d615a0a1fa . 2020-11-24 19:03:16 +00:00
Leandro Facchinetti e452838d27 Don’t store alternates explicitly to save disk space
Instead, fetch alternates from within the feed on the demand.

This makes alternates marginally more expensive to retrieve, but saves on storage (which we were running out on the DigitalOcean deployment), and is a cleaner architecture overall: no need to keep the feeds and alternates in sync.

Here’s a script to migrate existing feeds:

// Call me with, for example: env "BASE_URL=https://kill-the-newsletter.com" npx ts-node migrate.ts
// I’m idempotent and reentrant, you may call me multiple times if necessary (for example, if the migration fails in the middle for whatever reason)

import { promises as fs } from "fs";
import path from "path";
import { JSDOM } from "jsdom";

const BASE_URL = process.env.BASE_URL ?? "http://localhost:8000";
const FEEDS_PATH = "static/feeds";

(async () => {
  await fs.rmdir("static/alternate", { recursive: true });
  for (const feedPath of (await fs.readdir(FEEDS_PATH)).filter((feedPath) =>
    feedPath.endsWith(".xml")
  )) {
    const text = await fs.readFile(path.join(FEEDS_PATH, feedPath), "utf-8");
    const feed = new JSDOM(text, { contentType: "text/xml" });
    const document = feed.window.document;
    const feedIdentifier = document
      .querySelector("id")!
      .textContent!.split(":")[2];
    for (const entry of document.querySelectorAll("entry")) {
      const entryIdentifier = entry
        .querySelector("id")!
        .textContent!.split(":")[2];
      entry
        .querySelector(`link[rel="alternate"]`)
        ?.setAttribute(
          "href",
          `${BASE_URL}/alternate/${feedIdentifier}/${entryIdentifier}.html`
        );
    }
    await fs.writeFile(
      path.join(FEEDS_PATH, feedPath),
      `<?xml version="1.0" encoding="utf-8"?>${feed.serialize()}`.trim()
    );
    console.log(feedIdentifier);
  }
})();
2020-11-24 17:12:14 +00:00
Leandro Facchinetti 212b06eb49 . 2020-10-31 11:43:57 +00:00