created_at2024-04-29 23:57:11.352235
updated_at2024-04-30 00:28:50.407609
descriptionConvert archived Tweets to MarkDown with FrontMatter



Tweet Archive To Markdown

Convert archived Tweets to MarkDown with FrontMatter

Byte size of Tweet Archive To Markdown Open Issues Open Pull Requests Latest commits GitHub Actions Build Status License


This repository requires Rust language/compiler to build from source. As of last update to this ReadMe file, the recommended method of installing Rust is via their installer script;

curl --proto '=https' --tlsv1.2 -sSf | sh

Quick Start

This repository is a Rust binary

  • Install via cargo

    cargo install tweet-archive-to-markdown
  • Write tab completions for preferred shell (if supported), Bash with XDG support example;

    tweet-archive-to-markdown --build-completions "${_shell_name}" |
      tee "${_completions_directory}/tweet-archive-to-markdown" 1>/dev/null

    possible values: bash, elvish, fish, powershell, zsh


  • Print all available command-line options

    tweet-archive-to-markdown -h
    #> Convert archived Tweets to MarkDown with FrontMater
    #> Usage: tweet-archive-to-markdown [OPTIONS] --input-path <INPUT_PATH>
    #> Options:
    #>       --input-path <INPUT_PATH>
    #>           Path to input file
    #>       --output-directory <OUTPUT_DIRECTORY>
    #>           Path to directory where MarkDown files will be written
    #>       --javascript-pattern <JAVASCRIPT_PATTERN>
    #>           Useful if/when `--input-path` targets an explicit `data/tweets.js` file path [default: window.YTD.tweets.part0]
    #>       --post-date-format <POST_DATE_FORMAT>
    #>           Custom format string for `DateTime` output parsed from `.tweets[].tweet.created_at` used to
    #>           generate post FrontMatter for `date` YAML [default: "%F %T %z"]
    #>       --post-author <POST_AUTHOR>
    #>           Post `author` FrontMatter value for all MarkDown files written
    #>       --post-layout <POST_LAYOUT>
    #>           Post `layout` FrontMatter value for all MarkDown files written [default: post]
    #>       --post-twitter-key <POST_TWITTER_KEY>
    #>           FrontMatter key under which extra Twitter Post metadata and links will be provided [default: twitter]
    #>       --build-completions <BUILD_COMPLETIONS>
    #>           Output shell completions to standard out then exit [possible values: bash, elvish, fish, powershell, zsh]
    #>       --dry-run
    #>           Send data to standard out without writing files
    #>       --verbose
    #>           Send parsing data and debugging information to standard error
    #>   -h, --help
    #>           Print help (see more with '--help')
    #>   -V, --version
    #>           Print version
  • Example usage

    tweet-archive-to-markdown --input-path "~/Downloads/" \
      --output-directory "~/git/hub/${GH_NAME}" \
      --post-date-format "%Y-%m-%d %H:%M:%S %z" \
      --post-author "${GH_NAME}" \
      --post-layout "post" \
      --post-twitter-key "twitter" \
      --verbose \
  • Example result -- ~/git/hub/

    layout: post
    date: "2023-08-30 22:20:03 +0000"
    author: S0AndS0
    Anyone else occasionally annoyed we're not allowed to modify visibility of `details` HTML element children via `:target` ID with CSS only?
    details:is(:target) &gt; *:not(summary) {
      background: hotpink;
      display: block;
      visibility: visible;


This repository may not be feature complete and/or fully functional, Pull Requests that add features or fix bugs are certainly welcomed.


Options for contributing to tweet-archive-to-markdown and rust-utilities


:warning: Creating fork(s), submitting contribution(s), publishing derivative work(s), etc. based on this repository will form an agreement to be bound by the use-cased based licensing sub-sections.

I.E. if you choose to contribute to or use this project, you acknowledge and accept these usage based licensing terms will apply to any such works too.

Start making a Fork of this repository to an account that you have write permissions for.

  • Add remote for fork URL. The URL syntax is<NAME>/<REPO>.git...
cd ~/git/hub/rust-utilities/tweet-archive-to-markdown

git remote add fork<NAME>/tweet-archive-to-markdown.git
  • Commit your changes and push to your fork, eg. to fix an issue...
cd ~/git/hub/rust-utilities/tweet-archive-to-markdown

git commit -F- <<'EOF'
:bug: Fixes #42 Issue


- `<SCRIPT-NAME>` script, fixes some bug reported in issue

git push fork main

Note, the -u option may be used to set fork as the default remote, eg. git push -u fork main however, this will also default the fork remote for pulling from too! Meaning that pulling updates from origin must be done explicitly, eg. git pull origin main

  • Then on GitHub submit a Pull Request through the Web-UI, the URL syntax is<NAME>/<REPO>/pull/new/<BRANCH>

Note; to decrease the chances of your Pull Request needing modifications before being accepted, please check the dot-github repository for detailed contributing guidelines.


Thanks for even considering it!

Via Liberapay you may sponsor__shields_io__liberapay on a repeating basis.

Regardless of if you're able to financially support projects such as tweet-archive-to-markdown that rust-utilities maintains, please consider sharing projects that are useful with others, because one of the goals of maintaining Open Source repositories is to provide value to the community.



This project is licensed based on use-case

Commercial and/or proprietary use

If a project is either commercial or (||) proprietary, then please contact the author for pricing and licensing options to make use of code and/or features from this repository.

Non-commercial and FOSS use

If a project is both non-commercial and (&&) published with a licence compatible with AGPL-3.0, then it may utilize code from this repository under the following terms.

Convert archived Tweets to MarkDown with FrontMatter
Copyright (C) 2024 S0AndS0

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, version 3 of the License.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License
along with this program.  If not, see <>.
Commit count: 6

cargo fmt