2.0.46 • Published 8 months ago

@tweetback/canonical v2.0.46

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

@tweetback/canonical

A package to resolve twitter URLs to new canonically hosted twitter backups.

Installation

The package is available on npm: https://www.npmjs.com/package/@tweetback/canonical

npm install @tweetback/canonical

Usage

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

Add your own Twitter Archive:

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!

Please start your commit message with mapping:, it helps speed up the npm package release process.

The best example

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.

2.0.46

8 months ago

2.0.45

8 months ago

2.0.44

10 months ago

2.0.42

10 months ago

2.0.43

10 months ago

2.0.41

1 year ago

2.0.39

1 year ago

2.0.40

1 year ago

2.0.38

2 years ago

2.0.37

2 years ago

2.0.35

2 years ago

2.0.36

2 years ago

2.0.34

2 years ago

2.0.33

2 years ago

2.0.31

2 years ago

2.0.32

2 years ago

2.0.30

2 years ago

2.0.29

2 years ago

2.0.28

3 years ago

2.0.15

3 years ago

2.0.16

3 years ago

2.0.13

3 years ago

2.0.14

3 years ago

2.0.11

3 years ago

2.0.12

3 years ago

2.0.9

3 years ago

2.0.10

3 years ago

2.0.19

3 years ago

2.0.17

3 years ago

2.0.18

3 years ago

2.0.26

3 years ago

2.0.27

3 years ago

2.0.24

3 years ago

2.0.25

3 years ago

2.0.22

3 years ago

2.0.23

3 years ago

2.0.20

3 years ago

2.0.21

3 years ago

2.0.8

3 years ago

2.0.7

3 years ago

2.0.6

3 years ago

2.0.5

3 years ago

2.0.3

3 years ago

2.0.2

3 years ago

2.0.1

3 years ago

2.0.0

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago