A package to resolve twitter URLs to new canonically hosted twitter backups.
npm install @tweetback/canonical
import {transform} from "@tweetback/canonical";
transform("https://twitter.com/zachleat");
// Returns "https://www.zachleat.com/twitter/"
transform("https://twitter.com/eleven_ty");
// Returns "https://twitter.11ty.dev/"
Works with status URLs:
transform("https://twitter.com/zachleat/status/123");
// Returns "https://www.zachleat.com/twitter/123"
Other features:
- Passthrough any valid URLs as normal.
- Preserves trailing slashes (trailing slashes are optional)
- Normalizes duplicate slashes in the pathname
You needn’t use tweetback to add your archive here. The only requirement here is that your archive has URL parity and has individually addressable URLs for each status.
Just create a PR with your addition to the mapping.js
file and we’ll have a look!
This status https://twitter.11ty.dev/1559312029340557315 links to @TerribleMia’s archive which links back to the @eleven_ty archive. Threading across archives 🏆 while allowing each instance to maintain their own data.