webmention.io-backup

command module
v1.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 9, 2024 License: GPL-3.0 Imports: 13 Imported by: 0

README

webmention.io-backup

a little tool to backup webmentions stored in webmention.io

Build Status codecov Go Report Card

Table of Contents
Help webmention.io-backup get better!

Join the development (or just buy me a coffee, that helps, too).

How

Simpy run in command line with the desired options. For regular backups, set up a cron script or a systemd timer.

Command line options
-t [token]

the API token for webmention.io.

-d [domain]

only ask for webmentions received for specific domain (i.e. example.org); all the domains associated with the account will be processed otherwise.

-f [filename]

the name of the file to save webmentions to (and read the already backed-up webmentions from). Defaults to webmentions.json in current directory.

-jf2

use the /api/mentions.jf2 endpoint instead of /api/mentions. The produced JSON will naturally be JF2 in this case.

-tlo=false

don't create the top-level object in the saved file (i.e. save as an array of webmentions).

-p

pretty-print (jq-style) the saved file.

-cd [directory]

look in the directory for the directory structure that represents the website's structure and try to save webmentions to the individual files (one for each page) in this directory structure; useful for saving webmentions into the source tree of an SSG project.

-l [list]

list of comma-separated top-level directories to ignore when using -cd; with -cd ./website -l en,fr both webmentions for my.site/en/page and my.site/fr/page/ will be saved to ./website/page/webmentions.json instead of separate directories.

-lang

add language filename suffix if the path prefix was removed, only makes sense when using -l; this way mentions for my.site/en/page go to ./website/page/webmentions.en.json, for example.

-ts

when using -cd, store a timestamp in the root directory and avoid re-fetching webmentions before that timestamp.

Development

Issues reports and pull requests are always welcome!

Credits

This software includes the following software or parts thereof:

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL