Giter VIP home page Giter VIP logo

tweetback-canonical's Introduction

@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.

tweetback-canonical's People

Contributors

nhoizey avatar zachleat avatar semantic-release-bot avatar xdesro avatar accudio avatar chrisburnell avatar christopher-hayes avatar colinaut avatar dryan avatar ginader avatar aldreth avatar mvsde avatar reedyn avatar jakejarvis avatar jefflembeck avatar sentience avatar kimblim avatar lewisdaleuk avatar marcozehe avatar gauntface avatar matthewp avatar mirisuzanne avatar noleli avatar axbom avatar philhawksworth avatar rmayr avatar rknightuk avatar samthegeek avatar saneef avatar sophiekoonin avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.