aboutsummaryrefslogtreecommitdiffstats
path: root/README.md
blob: 132ab056b877c19c2667cc12dff0f67d6a4cc380 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# blogmirror

Mirrors <https://blog.sillylaird.ca> into flat, mothra-friendly HTML under
`html/`, in the same plain style as the rest of this site.

It reads the blog's RSS feed (`/feed.xml.php`), which carries the full post
body in `<content:encoded>`, so no HTML scraping is involved. Output:

    html/index.html                     post list
    html/YYYY/MM/DD/slug.html           one page per post

## Build (9front)

    mk

`blogmirror.c` is plain ANSI C and builds with APE `pcc`; it also builds with
`cc` on Linux/BSD for testing. Fetching uses `hget` when `/bin/hget` exists,
`curl` otherwise.

## Run

    ./blogmirror                        mirror the live feed into html/
    ./blogmirror -o /tmp/out            somewhere else
    ./blogmirror -n 10                  only the newest 10 posts
    ./blogmirror -f feed.rss            parse a feed already on disk
    ./blogmirror -u URL                 a different feed

## Refresh and publish

    ./mirror.rc

which regenerates `html/`, commits the changed files, and runs `git/push`.
Requires `git/fs`, a loaded ssh key in factotum, and a remote already set in
`.git/config`.