Take ownership of your Twitter data. First talked about at Jamstack Conf 2019 and in this blog post.
- Referenced on Delete Twitter!
- Built with Eleventy
- Each tweet has its own independent URL (with backwards/forwards threading!)
- Uses
@tweetback/canonical
to resolve other Twitter archives URLs (internal links stay in the archive and don’t link out to Twitter). t.co
links are bypassed and original hyperlinks URLs are used.- Links to users, tweets, non-truncated URLs.
- Nicer link formatting for links-to-tweets: @username/:id.
- Support some markdown: I sometimes use
backtick
markdown notation for code in my tweet text. This translates to<code>
properly. - Analytics:
- See your most popular tweets
- Who you retweet the most
- Who you reply to the most
- Frequently used swear words
- Top emoji
- Top hashtags
- Clone/download this repository
- In your terminal,
cd
to the folder of the project - Install Node.js (there are many ways to do this depending on your system and preferences; most package managers provide a package for it)
- Run
npm install
- Copy
./data/tweets.js
(or./data/tweet.js
) from your Twitter Archivezip
file into the./database
directory of this project.- Rename
window.YTD.tweets.part0
(orwindow.YTD.tweet.part0
) intweets.js
tomodule.exports
- Rename
- If you want to exclude Twitter Circles tweets (these are included in the archive, why 😭): copy
./data/twitter-circle-tweet.js
from your Twitter Archivezip
file into the./database
directory of this project.- Rename
window.YTD.tweets.part0
or (window.YTD.tweet.part0
) intwitter-circle-tweet.js
tomodule.exports
- Rename
- Run
npm run import
ornpm run import-without-circles
- Edit the
_data/metadata.js
file to add metadata information.username
is your Twitter username (no @ symbol)homeLabel
andhomeUrl
are the the name and URL of a homepage or other link to include at the top of the main archive pagedata.avatar
should link to a 16x16 pixel profile picture; the default will use the favicon from the website athomeUrl
- Run
npm run build
(will just create the proper files) ornpm start
(will run a server to look at them in your browser).- Optional: If you want the web site to live in a subdirectory (e.g.
/twitter/
), use Eleventy’s Path Prefix feature via the command line--pathprefix=twitter
or via a return object in your configuration file. Careful: this is an option to Eleventy and not npm, so it needs to live after a--
separator (for instance,npm run build -- --pathprefix=twitter
).
- Optional: If you want the web site to live in a subdirectory (e.g.
Note: Twitter no longer offers free API access
If you want to fetch additional tweets from the API and put them into your sqlite database:
- You will need a twitter developer token an a
TWITTER_BEARER_TOKEN
environment variable (from the Twitter API v2). Read more about App-only Bearer Tokens. - Run
npm run fetch-new-data
https://github.com/tweetback/tweetback-canonical has a mapping.js
file that stores the existing twitter username → canonical URL mappings. These will be transformed automatically to point to other archives in all tweetback
instances.
- To GitHub Pages