mirror of
https://github.com/msfjarvis/twt.git
synced 2024-06-03 04:08:58 +05:30
Compare commits
226 Commits
Author | SHA1 | Date | |
---|---|---|---|
0c8cc665c8 | |||
9586a22519 | |||
|
96d5232e9b | ||
|
81de1dd24d | ||
|
764098c5e1 | ||
|
3c0e6490e2 | ||
|
d6c39197a8 | ||
|
d8db87d367 | ||
|
ec203dca55 | ||
|
6a7c8eef42 | ||
b3aa3eda8c | |||
e33da6ee89 | |||
4d74ac1eac | |||
2e3fdf0e0d | |||
a9a80dc1bc | |||
|
334aaed4a2 | ||
|
5a969d4c6d | ||
|
0a56d56cd3 | ||
|
577756aa14 | ||
|
5a7a2c7f16 | ||
|
abb7f64f59 | ||
|
d49f01ebf9 | ||
|
d30c85daab | ||
|
cea87e0d88 | ||
|
eca2a3c49b | ||
|
dcb2f2b04d | ||
|
57c8fa3672 | ||
|
9608701836 | ||
|
e78f7e28d1 | ||
|
d8ce3c6b3c | ||
870076b3b8 | |||
5eead6d934 | |||
|
efc97d5038 | ||
|
9001c457e3 | ||
|
1458f36cdc | ||
|
6256eda1b4 | ||
|
d1648c757f | ||
|
121b11f579 | ||
|
cd93856847 | ||
|
671c31eee6 | ||
|
abfa233680 | ||
|
425e3ff6d5 | ||
|
b588dcd3fb | ||
|
0a3161d486 | ||
|
e4af62eaf7 | ||
|
7f51df92f0 | ||
|
23ce871f65 | ||
|
78abe6e4cb | ||
|
4ca2bdee90 | ||
|
fa8455b2b5 | ||
|
a5366e4440 | ||
|
be046836db | ||
|
f2e06b3a57 | ||
|
ce18179944 | ||
|
b6300f8c58 | ||
|
805efa15db | ||
|
437dc5cf6d | ||
|
12b9dbba79 | ||
4af3d21625 | |||
2c576e8605 | |||
8ddbd24e2f | |||
f3e92187a9 | |||
|
98765bd9b1 | ||
|
f9f29a5f8e | ||
|
bfaf872f83 | ||
|
d9daebfa4d | ||
|
ff7f194597 | ||
|
a804b839a0 | ||
|
9b900e899f | ||
|
6efbb84d12 | ||
|
82be669d0b | ||
|
bff2263b64 | ||
55abcc13ef | |||
aac27bdbf4 | |||
|
cabc777a00 | ||
|
49f6f291a7 | ||
|
4490497520 | ||
|
de49ffd003 | ||
|
79b6c20df9 | ||
|
e02d8fb312 | ||
ed1f5123f2 | |||
5659a496cf | |||
|
51d273c3dd | ||
|
53f4cdff77 | ||
091d8b66f7 | |||
8dce8650d9 | |||
|
dce81c4634 | ||
|
6ef4362467 | ||
|
e75ccf61d2 | ||
|
75f2d39be3 | ||
|
214c48faab | ||
|
32f798123c | ||
|
1af73d280b | ||
|
f492c29b2e | ||
|
c9e59fdcf3 | ||
|
57c66f9f11 | ||
|
ca6d98ce85 | ||
|
31d5c88bd4 | ||
|
febb11c049 | ||
9a7798fffc | |||
deae6168af | |||
|
8f34282b4f | ||
|
1551519e86 | ||
|
b67bb6ac1d | ||
|
a9d45bbe3d | ||
|
68adee42e6 | ||
|
30b3cb10fe | ||
|
b4294d1d9e | ||
|
0be9303f74 | ||
|
0e8e0263c6 | ||
5614082daa | |||
|
823939ee2b | ||
f4cc583c59 | |||
e184cdc21c | |||
60583b3abe | |||
4d4d00f30a | |||
7a609bb094 | |||
|
d9d546b6c9 | ||
67dee1b902 | |||
db12e7e919 | |||
8f65a28444 | |||
5d7272f32c | |||
|
8c3921a6fb | ||
|
8423660cfa | ||
|
5703372352 | ||
|
69818ee862 | ||
|
bda0a8b75c | ||
|
22c049cfab | ||
21a490c675 | |||
6eb291ba56 | |||
|
8880969f65 | ||
|
57571bfb3f | ||
9baa66c87d | |||
7c34dec8e2 | |||
7ec37ab477 | |||
cebc4f4d25 | |||
2c6cfcd409 | |||
4d3994ef2c | |||
|
d769a359f5 | ||
|
8e9ef6c905 | ||
|
c46c748418 | ||
|
05f7092948 | ||
|
461e8d606a | ||
|
d2d1deead1 | ||
|
9ab1cfae51 | ||
|
caa8871ae7 | ||
|
763afe0c5c | ||
|
17ff2a3e1d | ||
|
a182ef8133 | ||
|
b99fc6cb02 | ||
|
2f8706e330 | ||
cacbb422e0 | |||
|
651816de44 | ||
fed17af201 | |||
97eb7f96b2 | |||
ff41971c07 | |||
|
9b48a6701f | ||
b4cbba1b2a | |||
|
15d82e2f5b | ||
|
0e4b849efa | ||
|
3d43676562 | ||
|
941c954c52 | ||
|
67e269a8de | ||
|
ff7c45b549 | ||
|
78c8ce1ab1 | ||
|
6fc23bb4d4 | ||
|
b2389786b8 | ||
7ef4656302 | |||
f53eb72b12 | |||
|
f02cba45de | ||
|
02ae903893 | ||
|
1272fed0be | ||
|
62f263e7c8 | ||
|
978cfe68c7 | ||
|
c8d711eab6 | ||
|
54ddfc2634 | ||
|
70753fe66e | ||
9fc16f0c7f | |||
|
5bdb3de2f2 | ||
|
97586fcbe0 | ||
|
467913959c | ||
|
d5a063b0bc | ||
|
4bf58ea8ef | ||
|
d4340dfa60 | ||
|
33560a9923 | ||
|
8aa161a18a | ||
|
964d500bdd | ||
84168575a0 | |||
|
f2fa75a3f7 | ||
|
1f0badd338 | ||
|
011ee01792 | ||
|
8014bcc295 | ||
|
2b46ffda42 | ||
|
cc92802047 | ||
|
49d784aee2 | ||
47276cdc25 | |||
|
fcc6cdc17a | ||
|
e030ee5938 | ||
|
fae83793d8 | ||
|
8fa8b8b475 | ||
d3d7914800 | |||
c8e4e4856e | |||
87f7721348 | |||
799599982f | |||
5bfafd62d6 | |||
4f46b536de | |||
|
50b9a577fc | ||
|
384ab6a6b3 | ||
|
ddc5142751 | ||
d583a2666d | |||
80df0b0108 | |||
ca04c4696a | |||
22235c7dd6 | |||
06e2bee01f | |||
3a40de9966 | |||
|
e22f2f0eab | ||
|
479a1379af | ||
|
83dfa4c84e | ||
b9b12bea01 | |||
523dd0e8aa | |||
5862646aa3 | |||
805d22e68a | |||
ee16546de2 | |||
fcec95cc7e | |||
83496e4c49 | |||
2acc76d6a3 |
2
.cargo/audit.toml
Normal file
2
.cargo/audit.toml
Normal file
|
@ -0,0 +1,2 @@
|
|||
[advisories]
|
||||
ignore = ["RUSTSEC-2020-0071"]
|
2
.git-blame-ignore-revs
Normal file
2
.git-blame-ignore-revs
Normal file
|
@ -0,0 +1,2 @@
|
|||
# Reformat Nix files with Alejandra
|
||||
80df0b0108b23286ea2a8ff84ef82691784d0075
|
14
.github/workflows/flake-lock-maintenance.yml
vendored
Normal file
14
.github/workflows/flake-lock-maintenance.yml
vendored
Normal file
|
@ -0,0 +1,14 @@
|
|||
name: Update flake.lock
|
||||
on:
|
||||
workflow_dispatch:
|
||||
schedule:
|
||||
- cron: '0 6 * * 0'
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
update-flake-lock:
|
||||
uses: msfjarvis/shared-workflows/.github/workflows/update-flake-lock.yml@main
|
||||
secrets:
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
211
.github/workflows/release.yml
vendored
Normal file
211
.github/workflows/release.yml
vendored
Normal file
|
@ -0,0 +1,211 @@
|
|||
# Copyright 2022-2023, axodotdev
|
||||
# SPDX-License-Identifier: MIT or Apache-2.0
|
||||
#
|
||||
# CI that:
|
||||
#
|
||||
# * checks for a Git Tag that looks like a release
|
||||
# * creates a Github Release™ and fills in its text
|
||||
# * builds artifacts with cargo-dist (executable-zips, installers)
|
||||
# * uploads those artifacts to the Github Release™
|
||||
#
|
||||
# Note that the Github Release™ will be created before the artifacts,
|
||||
# so there will be a few minutes where the release has no artifacts
|
||||
# and then they will slowly trickle in, possibly failing. To make
|
||||
# this more pleasant we mark the release as a "draft" until all
|
||||
# artifacts have been successfully uploaded. This allows you to
|
||||
# choose what to do with partial successes and avoids spamming
|
||||
# anyone with notifications before the release is actually ready.
|
||||
name: Release
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
# This task will run whenever you push a git tag that looks like a version
|
||||
# like "v1", "v1.2.0", "v0.1.0-prerelease01", "my-app-v1.0.0", etc.
|
||||
# The version will be roughly parsed as ({PACKAGE_NAME}-)?v{VERSION}, where
|
||||
# PACKAGE_NAME must be the name of a Cargo package in your workspace, and VERSION
|
||||
# must be a Cargo-style SemVer Version.
|
||||
#
|
||||
# If PACKAGE_NAME is specified, then we will create a Github Release™ for that
|
||||
# package (erroring out if it doesn't have the given version or isn't cargo-dist-able).
|
||||
#
|
||||
# If PACKAGE_NAME isn't specified, then we will create a Github Release™ for all
|
||||
# (cargo-dist-able) packages in the workspace with that version (this is mode is
|
||||
# intended for workspaces with only one dist-able package, or with all dist-able
|
||||
# packages versioned/released in lockstep).
|
||||
#
|
||||
# If you push multiple tags at once, separate instances of this workflow will
|
||||
# spin up, creating an independent Github Release™ for each one.
|
||||
#
|
||||
# If there's a prerelease-style suffix to the version then the Github Release™
|
||||
# will be marked as a prerelease.
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- '*-?v[0-9]+*'
|
||||
|
||||
jobs:
|
||||
# Create the Github Release™ so the packages have something to be uploaded to
|
||||
create-release:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
has-releases: ${{ steps.create-release.outputs.has-releases }}
|
||||
releases: ${{ steps.create-release.outputs.releases }}
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
submodules: recursive
|
||||
- name: Install cargo-dist
|
||||
run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.2.0-prerelease.5/cargo-dist-installer.sh | sh"
|
||||
- id: create-release
|
||||
run: |
|
||||
cargo dist plan --tag=${{ github.ref_name }} --output-format=json > dist-manifest.json
|
||||
echo "dist plan ran successfully"
|
||||
cat dist-manifest.json
|
||||
|
||||
# Create the Github Release™ based on what cargo-dist thinks it should be
|
||||
ANNOUNCEMENT_TITLE=$(jq --raw-output ".announcement_title" dist-manifest.json)
|
||||
IS_PRERELEASE=$(jq --raw-output ".announcement_is_prerelease" dist-manifest.json)
|
||||
jq --raw-output ".announcement_github_body" dist-manifest.json > new_dist_announcement.md
|
||||
gh release create ${{ github.ref_name }} --draft --prerelease="$IS_PRERELEASE" --title="$ANNOUNCEMENT_TITLE" --notes-file=new_dist_announcement.md
|
||||
echo "created announcement!"
|
||||
|
||||
# Upload the manifest to the Github Release™
|
||||
gh release upload ${{ github.ref_name }} dist-manifest.json
|
||||
echo "uploaded manifest!"
|
||||
|
||||
# Disable all the upload-artifacts tasks if we have no actual releases
|
||||
HAS_RELEASES=$(jq --raw-output ".releases != null" dist-manifest.json)
|
||||
echo "has-releases=$HAS_RELEASES" >> "$GITHUB_OUTPUT"
|
||||
echo "releases=$(jq --compact-output ".releases" dist-manifest.json)" >> "$GITHUB_OUTPUT"
|
||||
|
||||
# Build and packages all the platform-specific things
|
||||
upload-local-artifacts:
|
||||
# Let the initial task tell us to not run (currently very blunt)
|
||||
needs: create-release
|
||||
if: ${{ needs.create-release.outputs.has-releases == 'true' }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
# For these target platforms
|
||||
include:
|
||||
- os: "macos-11"
|
||||
dist-args: "--artifacts=local --target=aarch64-apple-darwin"
|
||||
install-dist: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.2.0-prerelease.5/cargo-dist-installer.sh | sh"
|
||||
- os: "macos-11"
|
||||
dist-args: "--artifacts=local --target=x86_64-apple-darwin"
|
||||
install-dist: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.2.0-prerelease.5/cargo-dist-installer.sh | sh"
|
||||
- os: "windows-2019"
|
||||
dist-args: "--artifacts=local --target=x86_64-pc-windows-msvc"
|
||||
install-dist: "irm https://github.com/axodotdev/cargo-dist/releases/download/v0.2.0-prerelease.5/cargo-dist-installer.ps1 | iex"
|
||||
- os: "ubuntu-20.04"
|
||||
dist-args: "--artifacts=local --target=x86_64-unknown-linux-gnu"
|
||||
install-dist: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.2.0-prerelease.5/cargo-dist-installer.sh | sh"
|
||||
runs-on: ${{ matrix.os }}
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
submodules: recursive
|
||||
- name: Install cargo-dist
|
||||
run: ${{ matrix.install-dist }}
|
||||
- name: Run cargo-dist
|
||||
# This logic is a bit janky because it's trying to be a polyglot between
|
||||
# powershell and bash since this will run on windows, macos, and linux!
|
||||
# The two platforms don't agree on how to talk about env vars but they
|
||||
# do agree on 'cat' and '$()' so we use that to marshal values between commands.
|
||||
run: |
|
||||
# Actually do builds and make zips and whatnot
|
||||
cargo dist build --tag=${{ github.ref_name }} --output-format=json ${{ matrix.dist-args }} > dist-manifest.json
|
||||
echo "dist ran successfully"
|
||||
cat dist-manifest.json
|
||||
|
||||
# Parse out what we just built and upload it to the Github Release™
|
||||
jq --raw-output ".artifacts[]?.path | select( . != null )" dist-manifest.json > uploads.txt
|
||||
echo "uploading..."
|
||||
cat uploads.txt
|
||||
gh release upload ${{ github.ref_name }} $(cat uploads.txt)
|
||||
echo "uploaded!"
|
||||
|
||||
# Build and packages all the platform-agnostic(ish) things
|
||||
upload-global-artifacts:
|
||||
needs: upload-local-artifacts
|
||||
runs-on: "ubuntu-22.04"
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
submodules: recursive
|
||||
- name: Install cargo-dist
|
||||
run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.2.0-prerelease.5/cargo-dist-installer.sh | sh"
|
||||
# Get all the local artifacts for the global tasks to use (for e.g. checksums)
|
||||
- name: Fetch local artifacts
|
||||
run: |
|
||||
gh release download ${{ github.ref_name }} --dir target/distrib/
|
||||
- name: Run cargo-dist
|
||||
# This logic is a bit janky because it's trying to be a polyglot between
|
||||
# powershell and bash since this will run on windows, macos, and linux!
|
||||
# The two platforms don't agree on how to talk about env vars but they
|
||||
# do agree on 'cat' and '$()' so we use that to marshal values between commands.
|
||||
run: |
|
||||
cargo dist build --tag=${{ github.ref_name }} --output-format=json "--artifacts=global" > dist-manifest.json
|
||||
echo "dist ran successfully"
|
||||
cat dist-manifest.json
|
||||
|
||||
# Parse out what we just built and upload it to the Github Release™
|
||||
jq --raw-output ".artifacts[]?.path | select( . != null )" dist-manifest.json > uploads.txt
|
||||
echo "uploading..."
|
||||
cat uploads.txt
|
||||
gh release upload ${{ github.ref_name }} $(cat uploads.txt)
|
||||
echo "uploaded!"
|
||||
|
||||
upload-homebrew-formula:
|
||||
needs: [create-release, upload-global-artifacts]
|
||||
runs-on: "ubuntu-22.04"
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
RELEASES: ${{ needs.create-release.outputs.releases }}
|
||||
GITHUB_USER: "axo bot"
|
||||
GITHUB_EMAIL: "admin+bot@axo.dev"
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
repository: "msfjarvis/homebrew-tap"
|
||||
token: ${{ secrets.HOMEBREW_TAP_TOKEN }}
|
||||
# So we have access to the formula
|
||||
- name: Fetch local artifacts
|
||||
run: |
|
||||
gh release download ${{ github.ref_name }} --dir Formula --repo ${GITHUB_REPOSITORY} --clobber
|
||||
- name: Commit formula files
|
||||
run: |
|
||||
git config --global user.name "${GITHUB_USER}"
|
||||
git config --global user.email "${GITHUB_EMAIL}"
|
||||
|
||||
for release in $(echo "$RELEASES" | jq --compact-output '.[]'); do
|
||||
name=$(echo "$release" | jq .app_name --raw-output)
|
||||
version=$(echo "$release" | jq .app_version --raw-output)
|
||||
|
||||
git add Formula/${name}.rb
|
||||
git commit -m "${name} ${version}"
|
||||
done
|
||||
git push
|
||||
|
||||
# Mark the Github Release™ as a non-draft now that everything has succeeded!
|
||||
publish-release:
|
||||
# Only run after all the other tasks, but it's ok if upload-artifacts was skipped
|
||||
needs: [create-release, upload-local-artifacts, upload-global-artifacts]
|
||||
if: ${{ always() && needs.create-release.result == 'success' && (needs.upload-local-artifacts.result == 'skipped' || needs.upload-local-artifacts.result == 'success') && (needs.upload-global-artifacts.result == 'skipped' || needs.upload-global-artifacts.result == 'success') }}
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
submodules: recursive
|
||||
- name: mark release as non-draft
|
||||
run: |
|
||||
gh release edit ${{ github.ref_name }} --draft=false
|
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1 +1,2 @@
|
|||
/target
|
||||
/result
|
||||
|
|
807
Cargo.lock
generated
807
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
50
Cargo.toml
50
Cargo.toml
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "twt"
|
||||
version = "1.0.2"
|
||||
version = "1.2.5"
|
||||
edition = "2021"
|
||||
authors = ["Harsh Shandilya <me@msfjarvis.dev>"]
|
||||
license = "MIT/Apache-2.0"
|
||||
|
@ -13,13 +13,47 @@ publish = false
|
|||
include = ["src/main.rs", "LICENSE-*", "README.md"]
|
||||
|
||||
[dependencies]
|
||||
clap = { version = "4.1.4", features = [ "color", "deprecated", "derive", "env" ] }
|
||||
clap = { version = "4.4.0", features = [
|
||||
"color",
|
||||
"deprecated",
|
||||
"derive",
|
||||
"env",
|
||||
] }
|
||||
color-eyre = { version = "0.6.2", default-features = false }
|
||||
dirs = "4.0.0"
|
||||
egg-mode = { version = "0.16.0", features = ["rustls_webpki"], default-features = false }
|
||||
dirs = "5.0.1"
|
||||
egg-mode = { version = "0.16.1", features = [
|
||||
"rustls_webpki",
|
||||
], default-features = false }
|
||||
mime = "0.3"
|
||||
mime_guess = "2.0.4"
|
||||
serde = { version = "1.0.152", features = ["serde_derive"] }
|
||||
tokio = { version = "1.25.0", features = ["rt-multi-thread", "macros"] }
|
||||
toml = "0.7.1"
|
||||
url = "2.3.1"
|
||||
serde = "1.0.188"
|
||||
serde_derive = "1.0.188"
|
||||
tokio = { version = "1.32.0", features = ["rt-multi-thread", "macros"] }
|
||||
toml = "0.7.6"
|
||||
url = "2.4.0"
|
||||
|
||||
[features]
|
||||
videos = []
|
||||
|
||||
# generated by 'cargo dist init'
|
||||
[profile.dist]
|
||||
inherits = "release"
|
||||
debug = true
|
||||
split-debuginfo = "packed"
|
||||
|
||||
# Config for 'cargo dist'
|
||||
[workspace.metadata.dist]
|
||||
# The preferred cargo-dist version to use in CI (Cargo.toml SemVer syntax)
|
||||
cargo-dist-version = "0.2.0-prerelease.5"
|
||||
# CI backends to support (see 'cargo dist generate-ci')
|
||||
ci = ["github"]
|
||||
# The installers to generate for each app
|
||||
installers = ["shell", "powershell", "homebrew"]
|
||||
# A GitHub repo to push Homebrew formulas to
|
||||
tap = "msfjarvis/homebrew-tap"
|
||||
# Target platforms to build apps for (Rust target-triple syntax)
|
||||
targets = ["x86_64-unknown-linux-gnu", "x86_64-apple-darwin", "x86_64-pc-windows-msvc", "aarch64-apple-darwin"]
|
||||
# Publish jobs to run in CI
|
||||
publish-jobs = ["homebrew"]
|
||||
# Whether to consider the binaries in a package for distribution (defaults true)
|
||||
dist = true
|
||||
|
|
64
README.md
64
README.md
|
@ -1,48 +1,50 @@
|
|||
# twt [![No Maintenance Intended](http://unmaintained.tech/badge.svg)](http://unmaintained.tech/)
|
||||
> [!WARNING]
|
||||
> Due to Twitter's complete decimation of its API, `twt` no longer works for most use cases and is thus not going to be maintained going forward.
|
||||
|
||||
# twt [![Built with Garnix](https://img.shields.io/endpoint?url=https%3A%2F%2Fgarnix.io%2Fapi%2Fbadges%2Fmsfjarvis%2Ftwt%3Fbranch%3Dmain)](https://garnix.io)
|
||||
|
||||
CLI tool to extract metadata from tweets
|
||||
|
||||
## Usage
|
||||
## Install
|
||||
|
||||
There are unlikely to ever be published binaries for this, so this requires a Rust development environment set up locally.
|
||||
Check out the [website](https://msfjarvis.github.io/twt/)
|
||||
|
||||
```shell
|
||||
git clone https://github.com/msfjarvis/twitter-images.git
|
||||
cd twitter-images
|
||||
cargo build --release
|
||||
## Setup
|
||||
|
||||
This tool requires Twitter consumer keys to function. Twitter is moving to [disallow free usage of the API](https://fxtwitter.com/twitterdev/status/1621026986784337922), so you will have to steal their own keys to work around this.
|
||||
|
||||
`twt` picks up keys from `$CONFIG_DIR/twt/config.toml` (see [here](https://docs.rs/dirs/latest/dirs/fn.config_dir.html) for your platform's interpretation of `$CONFIG_DIR`)
|
||||
|
||||
```toml
|
||||
# config.toml
|
||||
consumer_key = "totally_real_key"
|
||||
consumer_key_secret = "h4xx0r"
|
||||
```
|
||||
|
||||
The tool is built to avoid interactive login and relies on the presence of a bunch of environment variables at build-time that require a Twitter developer account and a project created on the account to obtain.
|
||||
## Usage
|
||||
|
||||
- `CONSUMER_KEY` - The consumer API key for the project.
|
||||
- `CONSUMER_KEY_SECRET` - The consumer secret for the project.
|
||||
- `ACCESS_TOKEN` - Authentication access token for your user, for the project.
|
||||
- `ACCESS_TOKEN_SECRET` - Access secret for your user.
|
||||
### Get image links
|
||||
|
||||
## Examples
|
||||
```
|
||||
twt images --username archillect
|
||||
```
|
||||
|
||||
- **Get image links**
|
||||
### Get video links
|
||||
|
||||
```sh
|
||||
twt images --username archillect
|
||||
```
|
||||
```
|
||||
twt videos --username imgur
|
||||
```
|
||||
|
||||
- **Get video links**
|
||||
### Set the maximum tweets to check
|
||||
|
||||
```sh
|
||||
twt videos --username imgur
|
||||
```
|
||||
```
|
||||
twt images --username archillect --max-amount 512
|
||||
```
|
||||
|
||||
- **Set the maximum tweets to check**
|
||||
### Get all links
|
||||
|
||||
```sh
|
||||
twt images --username archillect --max-amount 512
|
||||
```
|
||||
|
||||
- **Get all links**
|
||||
|
||||
```sh
|
||||
twt links --username AITA_online --host bit.ly
|
||||
```
|
||||
```
|
||||
twt links --username AITA_online --host bit.ly
|
||||
```
|
||||
|
||||
For more help run: `twt -h`.
|
||||
|
|
14
default.nix
14
default.nix
|
@ -1,6 +1,8 @@
|
|||
(import (let lock = builtins.fromJSON (builtins.readFile ./flake.lock);
|
||||
in fetchTarball {
|
||||
url =
|
||||
"https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz";
|
||||
sha256 = lock.nodes.flake-compat.locked.narHash;
|
||||
}) { src = ./.; }).defaultNix
|
||||
(import (let
|
||||
lock = builtins.fromJSON (builtins.readFile ./flake.lock);
|
||||
in
|
||||
fetchTarball {
|
||||
url = "https://github.com/nix-community/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz";
|
||||
sha256 = lock.nodes.flake-compat.locked.narHash;
|
||||
}) {src = ./.;})
|
||||
.defaultNix
|
||||
|
|
57
deny.toml
57
deny.toml
|
@ -1,57 +0,0 @@
|
|||
targets = [
|
||||
{ triple = "x86_64-unknown-linux-gnu" },
|
||||
{ triple = "aarch64-unknown-linux-gnu" },
|
||||
{ triple = "x86_64-unknown-linux-musl" },
|
||||
{ triple = "aarch64-apple-darwin" },
|
||||
{ triple = "x86_64-apple-darwin" },
|
||||
{ triple = "x86_64-pc-windows-msvc" },
|
||||
]
|
||||
|
||||
[advisories]
|
||||
db-path = "~/.cargo/advisory-db"
|
||||
db-urls = ["https://github.com/rustsec/advisory-db"]
|
||||
vulnerability = "deny"
|
||||
unmaintained = "warn"
|
||||
yanked = "warn"
|
||||
notice = "warn"
|
||||
ignore = [
|
||||
"RUSTSEC-2020-0071", # same localtime_r vulnerability, but for the time crate
|
||||
]
|
||||
[licenses]
|
||||
unlicensed = "deny"
|
||||
allow = [
|
||||
"MIT",
|
||||
"Apache-2.0",
|
||||
]
|
||||
copyleft = "allow"
|
||||
allow-osi-fsf-free = "neither"
|
||||
default = "deny"
|
||||
confidence-threshold = 0.8
|
||||
exceptions = [
|
||||
{ allow = ["BSD-3-Clause"], name = "subtle", version = "*" },
|
||||
{ allow = ["MIT", "ISC", "OpenSSL"], name = "ring", version = "*" },
|
||||
{ allow = ["ISC"], name = "untrusted", version = "*" },
|
||||
{ allow = ["ISC"], name = "webpki", version = "*" },
|
||||
{ allow = ["Unicode-DFS-2016"], name = "unicode-ident", version = "*" },
|
||||
]
|
||||
|
||||
[[licenses.clarify]]
|
||||
name = "ring"
|
||||
version = "*"
|
||||
expression = "MIT AND ISC AND OpenSSL"
|
||||
license-files = [
|
||||
{ path = "LICENSE", hash = 0xbd0eed23 }
|
||||
]
|
||||
|
||||
[licenses.private]
|
||||
ignore = false
|
||||
|
||||
[bans]
|
||||
multiple-versions = "deny"
|
||||
wildcards = "deny"
|
||||
highlight = "all"
|
||||
|
||||
[sources]
|
||||
unknown-registry = "deny"
|
||||
unknown-git = "deny"
|
||||
allow-git = []
|
245
docs/artifacts.js
Normal file
245
docs/artifacts.js
Normal file
|
@ -0,0 +1,245 @@
|
|||
/* Code modified from the blender website
|
||||
* https://www.blender.org/wp-content/themes/bthree/assets/js/get_os.js?x82196
|
||||
*/
|
||||
|
||||
let options = {
|
||||
windows64: "x86_64-pc-windows",
|
||||
windows32: "i686-pc-windows",
|
||||
windowsArm: "aarch64-pc-windows",
|
||||
|
||||
mac64: "x86_64-apple",
|
||||
mac32: "i686-apple",
|
||||
macSilicon: "aarch64-apple",
|
||||
|
||||
linux64: "x86_64-unknown-linux",
|
||||
linux32: "i686-unknown-linux",
|
||||
linuxArm: "aarch64-unknown-linux",
|
||||
|
||||
// ios: "ios",
|
||||
// android: "linux-android",
|
||||
// freebsd: "freebsd",
|
||||
};
|
||||
|
||||
function isAppleSilicon() {
|
||||
try {
|
||||
var glcontext = document.createElement("canvas").getContext("webgl");
|
||||
var debugrenderer = glcontext
|
||||
? glcontext.getExtension("WEBGL_debug_renderer_info")
|
||||
: null;
|
||||
var renderername =
|
||||
(debugrenderer &&
|
||||
glcontext.getParameter(debugrenderer.UNMASKED_RENDERER_WEBGL)) ||
|
||||
"";
|
||||
if (renderername.match(/Apple M/) || renderername.match(/Apple GPU/)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
} catch (e) {}
|
||||
}
|
||||
|
||||
function getOS() {
|
||||
var OS = options.windows64.default;
|
||||
var userAgent = navigator.userAgent;
|
||||
var platform = navigator.platform;
|
||||
|
||||
if (navigator.appVersion.includes("Win")) {
|
||||
if (
|
||||
!userAgent.includes("Windows NT 5.0") &&
|
||||
!userAgent.includes("Windows NT 5.1") &&
|
||||
(userAgent.indexOf("Win64") > -1 ||
|
||||
platform == "Win64" ||
|
||||
userAgent.indexOf("x86_64") > -1 ||
|
||||
userAgent.indexOf("x86_64") > -1 ||
|
||||
userAgent.indexOf("amd64") > -1 ||
|
||||
userAgent.indexOf("AMD64") > -1 ||
|
||||
userAgent.indexOf("WOW64") > -1)
|
||||
) {
|
||||
OS = options.windows64;
|
||||
} else {
|
||||
if (
|
||||
window.external &&
|
||||
window.external.getHostEnvironmentValue &&
|
||||
window.external
|
||||
.getHostEnvironmentValue("os-architecture")
|
||||
.includes("ARM64")
|
||||
) {
|
||||
OS = options.windowsArm;
|
||||
} else {
|
||||
try {
|
||||
var canvas = document.createElement("canvas");
|
||||
var gl = canvas.getContext("webgl");
|
||||
|
||||
var debugInfo = gl.getExtension("WEBGL_debug_renderer_info");
|
||||
var renderer = gl.getParameter(debugInfo.UNMASKED_RENDERER_WEBGL);
|
||||
if (renderer.includes("Qualcomm")) OS = options.windowsArm;
|
||||
} catch (e) {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//MacOS, MacOS X, macOS
|
||||
if (navigator.appVersion.includes("Mac")) {
|
||||
if (
|
||||
navigator.userAgent.includes("OS X 10.5") ||
|
||||
navigator.userAgent.includes("OS X 10.6")
|
||||
) {
|
||||
OS = options.mac32;
|
||||
} else {
|
||||
OS = options.mac64;
|
||||
|
||||
const isSilicon = isAppleSilicon();
|
||||
if (isSilicon) {
|
||||
OS = options.macSilicon;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// linux
|
||||
if (platform.includes("Linux")) {
|
||||
OS = options.linux64;
|
||||
// FIXME: Can we find out whether linux 32-bit or ARM are used?
|
||||
}
|
||||
|
||||
// if (
|
||||
// userAgent.includes("iPad") ||
|
||||
// userAgent.includes("iPhone") ||
|
||||
// userAgent.includes("iPod")
|
||||
// ) {
|
||||
// OS = options.ios;
|
||||
// }
|
||||
// if (platform.toLocaleLowerCase().includes("freebsd")) {
|
||||
// OS = options.freebsd;
|
||||
// }
|
||||
|
||||
return OS;
|
||||
}
|
||||
|
||||
let os = getOS();
|
||||
window.os = os;
|
||||
|
||||
// Unhide and hydrate selector with events
|
||||
const archSelect = document.querySelector(".arch-select");
|
||||
if (archSelect) {
|
||||
archSelect.classList.remove("hidden");
|
||||
const selector = document.querySelector("#install-arch-select");
|
||||
if (selector) {
|
||||
selector.addEventListener("change", onArchChange);
|
||||
}
|
||||
}
|
||||
|
||||
// Hydrate tab buttons with events
|
||||
Array.from(document.querySelectorAll(".install-tab[data-id]")).forEach((tab) => {
|
||||
tab.addEventListener("click", onTabClick);
|
||||
});
|
||||
|
||||
function onArchChange(evt) {
|
||||
// Get target
|
||||
const target = evt.currentTarget.value;
|
||||
// Find corresponding installer lists
|
||||
const newContentEl = document.querySelector(`.arch[data-arch=${target}]`);
|
||||
const oldContentEl = document.querySelector(`.arch[data-arch]:not(.hidden)`);
|
||||
// Hide old content element (if applicable)
|
||||
if (oldContentEl) {
|
||||
oldContentEl.classList.add("hidden");
|
||||
}
|
||||
// Show new content element
|
||||
newContentEl.classList.remove("hidden");
|
||||
// Show the first tab's content if nothing was selected before
|
||||
if (newContentEl.querySelectorAll(".install-tab.selected").length === 0) {
|
||||
const firstContentChild = newContentEl.querySelector(".install-content:first-of-type");
|
||||
const firstTabChild = newContentEl.querySelector(".install-tab:first-of-type");
|
||||
firstContentChild.classList.remove("hidden");
|
||||
if (firstTabChild) {
|
||||
firstTabChild.classList.add("selected");
|
||||
}
|
||||
}
|
||||
// Hide "no OS detected" message
|
||||
const noDetectEl = document.querySelector(".no-autodetect");
|
||||
noDetectEl.classList.add("hidden");
|
||||
// Hide Mac hint
|
||||
document.querySelector(".mac-switch").classList.add("hidden");
|
||||
}
|
||||
|
||||
function onTabClick(evt) {
|
||||
// Get target and ID
|
||||
const {triple, id} = evt.currentTarget.dataset;
|
||||
if (triple) {
|
||||
// Find corresponding content elements
|
||||
const newContentEl = document.querySelector(`.install-content[data-id="${String(id)}"][data-triple=${triple}]`);
|
||||
const oldContentEl = document.querySelector(`.install-content[data-triple=${triple}][data-id]:not(.hidden)`);
|
||||
// Find old tab to unselect
|
||||
const oldTabEl = document.querySelector(`.install-tab[data-triple=${triple}].selected`);
|
||||
// Hide old content element
|
||||
if (oldContentEl && oldTabEl) {
|
||||
oldContentEl.classList.add("hidden");
|
||||
oldTabEl.classList.remove("selected");
|
||||
}
|
||||
|
||||
// Unhide new content element
|
||||
newContentEl.classList.remove("hidden");
|
||||
// Select new tab element
|
||||
evt.currentTarget.classList.add("selected");
|
||||
}
|
||||
}
|
||||
|
||||
const allPlatforms = Array.from(document.querySelectorAll(`.arch[data-arch]`));
|
||||
let hit = allPlatforms.find(
|
||||
(a) => {
|
||||
// Show Intel Mac downloads if no M1 Mac downloads are available
|
||||
if (
|
||||
a.attributes["data-arch"].value.includes(options.mac64) &&
|
||||
os.includes(options.macSilicon) &&
|
||||
!allPlatforms.find(p => p.attributes["data-arch"].value.includes(options.macSilicon))) {
|
||||
// Unhide hint
|
||||
document.querySelector(".mac-switch").classList.remove("hidden");
|
||||
return true;
|
||||
}
|
||||
return a.attributes["data-arch"].value.includes(os);
|
||||
}
|
||||
);
|
||||
|
||||
if (hit) {
|
||||
hit.classList.remove("hidden");
|
||||
const selectEl = document.querySelector("#install-arch-select");
|
||||
selectEl.value = hit.dataset.arch;
|
||||
const firstContentChild = hit.querySelector(".install-content:first-of-type");
|
||||
const firstTabChild = hit.querySelector(".install-tab:first-of-type");
|
||||
firstContentChild.classList.remove("hidden");
|
||||
if (firstTabChild) {
|
||||
firstTabChild.classList.add("selected");
|
||||
}
|
||||
} else {
|
||||
const noDetectEl = document.querySelector(".no-autodetect");
|
||||
if (noDetectEl) {
|
||||
const noDetectElDetails = document.querySelector(".no-autodetect-details");
|
||||
if (noDetectElDetails) {
|
||||
noDetectElDetails.innerHTML = `We detected you're on ${os} but there don't seem to be installers for that. `
|
||||
}
|
||||
noDetectEl.classList.remove("hidden");
|
||||
}
|
||||
}
|
||||
|
||||
let copyButtons = Array.from(document.querySelectorAll("[data-copy]"));
|
||||
if (copyButtons.length) {
|
||||
copyButtons.forEach(function (element) {
|
||||
element.addEventListener("click", () => {
|
||||
navigator.clipboard.writeText(element.attributes["data-copy"].value);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
// Toggle for pre releases
|
||||
const checkbox = document.getElementById("show-prereleases");
|
||||
|
||||
if (checkbox) {
|
||||
checkbox.addEventListener("click", () => {
|
||||
const all = document.getElementsByClassName("pre-release");
|
||||
|
||||
if (all) {
|
||||
for (var item of all) {
|
||||
item.classList.toggle("hidden");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
213
docs/artifacts/index.html
Normal file
213
docs/artifacts/index.html
Normal file
|
@ -0,0 +1,213 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en" id="oranda" class="dark">
|
||||
<head>
|
||||
<title>twt</title>
|
||||
|
||||
<meta property="og:url" content="https://github.com/msfjarvis/twt" />
|
||||
|
||||
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
|
||||
<meta name="description" content="Tools for extracting metadata from tweets" />
|
||||
<meta property="og:description" content="Tools for extracting metadata from tweets" />
|
||||
|
||||
<meta property="og:type" content="website" />
|
||||
<meta property="og:title" content="twt" />
|
||||
|
||||
|
||||
|
||||
<meta http-equiv="Permissions-Policy" content="interest-cohort=()" />
|
||||
<link rel="stylesheet" href="/twt/oranda-v0.3.0-prerelease.4.css" />
|
||||
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<div class="page-body">
|
||||
|
||||
<div class="repo_banner">
|
||||
<a href="https://github.com/msfjarvis/twt">
|
||||
<div class="github-icon" aria-hidden="true"></div>
|
||||
Check out our GitHub!
|
||||
</a>
|
||||
</div>
|
||||
|
||||
|
||||
<main>
|
||||
<header>
|
||||
|
||||
<h1 class="title">twt</h1>
|
||||
|
||||
<nav class="nav">
|
||||
<ul>
|
||||
<li><a href="/twt/">Home</a></li>
|
||||
|
||||
|
||||
|
||||
|
||||
<li><a href="/twt/artifacts/">Install</a></li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
</header>
|
||||
|
||||
|
||||
<div>
|
||||
<div class="package-managers-downloads">
|
||||
|
||||
|
||||
|
||||
<div>
|
||||
<h3>nix flakes</h3>
|
||||
<div class="install-code-wrapper">
|
||||
<pre style="background-color:#263238;">
|
||||
<span style="color:#82aaff;">nix profile install github:msfjarvis/twt</span></pre>
|
||||
|
||||
<button class="button copy-clipboard-button primary" data-copy="nix profile install github:msfjarvis/twt">
|
||||
<svg stroke='currentColor' fill='currentColor' stroke-width='0' viewBox='0 0 20 20' height='1em' width='1em' xmlns='http://www.w3.org/2000/svg'><path d='M8 2a1 1 0 000 2h2a1 1 0 100-2H8z'></path><path d='M3 5a2 2 0 012-2 3 3 0 003 3h2a3 3 0 003-3 2 2 0 012 2v6h-4.586l1.293-1.293a1 1 0 00-1.414-1.414l-3 3a1 1 0 000 1.414l3 3a1 1 0 001.414-1.414L10.414 13H15v3a2 2 0 01-2 2H5a2 2 0 01-2-2V5zM15 11h2a1 1 0 110 2h-2v-2z'></path></svg>
|
||||
</button>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<div>
|
||||
<h3>powershell</h3>
|
||||
<div class="install-code-wrapper">
|
||||
<pre style="background-color:#263238;">
|
||||
<span style="color:#82aaff;">irm https://github.com/msfjarvis/twt/releases/download/v1.2.4/installer.ps1 </span><span style="color:#89ddff;">| </span><span style="color:#82aaff;">iex</span></pre>
|
||||
|
||||
<button class="button copy-clipboard-button primary" data-copy="irm https://github.com/msfjarvis/twt/releases/download/v1.2.4/installer.ps1 | iex">
|
||||
<svg stroke='currentColor' fill='currentColor' stroke-width='0' viewBox='0 0 20 20' height='1em' width='1em' xmlns='http://www.w3.org/2000/svg'><path d='M8 2a1 1 0 000 2h2a1 1 0 100-2H8z'></path><path d='M3 5a2 2 0 012-2 3 3 0 003 3h2a3 3 0 003-3 2 2 0 012 2v6h-4.586l1.293-1.293a1 1 0 00-1.414-1.414l-3 3a1 1 0 000 1.414l3 3a1 1 0 001.414-1.414L10.414 13H15v3a2 2 0 01-2 2H5a2 2 0 01-2-2V5zM15 11h2a1 1 0 110 2h-2v-2z'></path></svg>
|
||||
</button>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a class="button primary" href="/twt/installer.ps1.txt">Source</a>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<div>
|
||||
<h3>shell</h3>
|
||||
<div class="install-code-wrapper">
|
||||
<pre style="background-color:#263238;">
|
||||
<span style="color:#82aaff;">curl</span><span style="color:#89ddff;"> --</span><span style="color:#f78c6c;">proto </span><span style="color:#89ddff;">'</span><span style="color:#c3e88d;">=https</span><span style="color:#89ddff;">' --</span><span style="color:#f78c6c;">tlsv1</span><span style="color:#82aaff;">.2</span><span style="color:#89ddff;"> -</span><span style="color:#f78c6c;">LsSf</span><span style="color:#82aaff;"> https://github.com/msfjarvis/twt/releases/download/v1.2.4/installer.sh </span><span style="color:#89ddff;">| </span><span style="color:#82aaff;">sh</span></pre>
|
||||
|
||||
<button class="button copy-clipboard-button primary" data-copy="curl --proto '=https' --tlsv1.2 -LsSf https://github.com/msfjarvis/twt/releases/download/v1.2.4/installer.sh | sh">
|
||||
<svg stroke='currentColor' fill='currentColor' stroke-width='0' viewBox='0 0 20 20' height='1em' width='1em' xmlns='http://www.w3.org/2000/svg'><path d='M8 2a1 1 0 000 2h2a1 1 0 100-2H8z'></path><path d='M3 5a2 2 0 012-2 3 3 0 003 3h2a3 3 0 003-3 2 2 0 012 2v6h-4.586l1.293-1.293a1 1 0 00-1.414-1.414l-3 3a1 1 0 000 1.414l3 3a1 1 0 001.414-1.414L10.414 13H15v3a2 2 0 01-2 2H5a2 2 0 01-2-2V5zM15 11h2a1 1 0 110 2h-2v-2z'></path></svg>
|
||||
</button>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a class="button primary" href="/twt/installer.sh.txt">Source</a>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<div>
|
||||
<h3>Downloads</h3>
|
||||
<table class="artifacts-table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>File</th>
|
||||
<th>Platform</th>
|
||||
|
||||
</tr>
|
||||
|
||||
|
||||
|
||||
<tr>
|
||||
<td><a href="https://github.com/msfjarvis/twt/releases/download/v1.2.4/twt-v1.2.4-x86_64-apple-darwin.tar.xz">twt-v1.2.4-x86_64-apple-darwin.tar.xz</a></td>
|
||||
<td>
|
||||
|
||||
|
||||
macOS Intel
|
||||
|
||||
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
|
||||
|
||||
|
||||
<tr>
|
||||
<td><a href="https://github.com/msfjarvis/twt/releases/download/v1.2.4/twt-v1.2.4-x86_64-pc-windows-msvc.zip">twt-v1.2.4-x86_64-pc-windows-msvc.zip</a></td>
|
||||
<td>
|
||||
|
||||
|
||||
Windows x64
|
||||
|
||||
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
|
||||
|
||||
|
||||
<tr>
|
||||
<td><a href="https://github.com/msfjarvis/twt/releases/download/v1.2.4/twt-v1.2.4-x86_64-unknown-linux-gnu.tar.xz">twt-v1.2.4-x86_64-unknown-linux-gnu.tar.xz</a></td>
|
||||
<td>
|
||||
|
||||
|
||||
Linux x64
|
||||
|
||||
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</main>
|
||||
</div>
|
||||
|
||||
<footer>
|
||||
|
||||
<a href="https://github.com/msfjarvis/twt"><div class="github-icon" aria-hidden="true"></div></a>
|
||||
|
||||
<span>
|
||||
twt, MIT/Apache-2.0
|
||||
</span>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script src="/twt/artifacts.js"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
510
docs/index.html
Normal file
510
docs/index.html
Normal file
|
@ -0,0 +1,510 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en" id="oranda" class="dark">
|
||||
<head>
|
||||
<title>twt</title>
|
||||
|
||||
<meta property="og:url" content="https://github.com/msfjarvis/twt" />
|
||||
|
||||
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
|
||||
<meta name="description" content="Tools for extracting metadata from tweets" />
|
||||
<meta property="og:description" content="Tools for extracting metadata from tweets" />
|
||||
|
||||
<meta property="og:type" content="website" />
|
||||
<meta property="og:title" content="twt" />
|
||||
|
||||
|
||||
|
||||
<meta http-equiv="Permissions-Policy" content="interest-cohort=()" />
|
||||
<link rel="stylesheet" href="/twt/oranda-v0.3.0-prerelease.4.css" />
|
||||
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<div class="page-body">
|
||||
|
||||
<div class="repo_banner">
|
||||
<a href="https://github.com/msfjarvis/twt">
|
||||
<div class="github-icon" aria-hidden="true"></div>
|
||||
Check out our GitHub!
|
||||
</a>
|
||||
</div>
|
||||
|
||||
|
||||
<main>
|
||||
<header>
|
||||
|
||||
<h1 class="title">twt</h1>
|
||||
|
||||
<nav class="nav">
|
||||
<ul>
|
||||
<li><a href="/twt/">Home</a></li>
|
||||
|
||||
|
||||
|
||||
|
||||
<li><a href="/twt/artifacts/">Install</a></li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
</header>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="artifacts" data-tag="v1.2.4">
|
||||
<div class="artifact-header target">
|
||||
<h4>Install v1.2.4</h4>
|
||||
|
||||
<div><small class="published-date">Published on Aug 16 2023 at 09:55 UTC</small></div>
|
||||
|
||||
|
||||
<ul class="arches">
|
||||
|
||||
<li class="arch hidden" data-arch="x86_64-unknown-linux-gnu">
|
||||
|
||||
<ul class="tabs">
|
||||
|
||||
|
||||
|
||||
<li class="install-tab" data-id="2" data-triple="x86_64-unknown-linux-gnu">
|
||||
shell
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li class="install-tab" data-id="0" data-triple="x86_64-unknown-linux-gnu">
|
||||
nix flakes
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li class="install-tab" data-id="5" data-triple="x86_64-unknown-linux-gnu">
|
||||
tarball
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
<ul class="contents">
|
||||
|
||||
|
||||
<li data-id="2" data-triple="x86_64-unknown-linux-gnu" class="install-content">
|
||||
|
||||
|
||||
<div class="install-code-wrapper">
|
||||
<pre style="background-color:#263238;">
|
||||
<span style="color:#82aaff;">curl</span><span style="color:#89ddff;"> --</span><span style="color:#f78c6c;">proto </span><span style="color:#89ddff;">'</span><span style="color:#c3e88d;">=https</span><span style="color:#89ddff;">' --</span><span style="color:#f78c6c;">tlsv1</span><span style="color:#82aaff;">.2</span><span style="color:#89ddff;"> -</span><span style="color:#f78c6c;">LsSf</span><span style="color:#82aaff;"> https://github.com/msfjarvis/twt/releases/download/v1.2.4/installer.sh </span><span style="color:#89ddff;">| </span><span style="color:#82aaff;">sh</span></pre>
|
||||
|
||||
<button class="button copy-clipboard-button primary" data-copy="curl --proto '=https' --tlsv1.2 -LsSf https://github.com/msfjarvis/twt/releases/download/v1.2.4/installer.sh | sh">
|
||||
<svg stroke='currentColor' fill='currentColor' stroke-width='0' viewBox='0 0 20 20' height='1em' width='1em' xmlns='http://www.w3.org/2000/svg'><path d='M8 2a1 1 0 000 2h2a1 1 0 100-2H8z'></path><path d='M3 5a2 2 0 012-2 3 3 0 003 3h2a3 3 0 003-3 2 2 0 012 2v6h-4.586l1.293-1.293a1 1 0 00-1.414-1.414l-3 3a1 1 0 000 1.414l3 3a1 1 0 001.414-1.414L10.414 13H15v3a2 2 0 01-2 2H5a2 2 0 01-2-2V5zM15 11h2a1 1 0 110 2h-2v-2z'></path></svg>
|
||||
</button>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a class="button primary" href="/twt/installer.sh.txt">Source</a>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li data-id="0" data-triple="x86_64-unknown-linux-gnu" class="install-content hidden">
|
||||
|
||||
|
||||
<div class="install-code-wrapper">
|
||||
<pre style="background-color:#263238;">
|
||||
<span style="color:#82aaff;">nix profile install github:msfjarvis/twt</span></pre>
|
||||
|
||||
<button class="button copy-clipboard-button primary" data-copy="nix profile install github:msfjarvis/twt">
|
||||
<svg stroke='currentColor' fill='currentColor' stroke-width='0' viewBox='0 0 20 20' height='1em' width='1em' xmlns='http://www.w3.org/2000/svg'><path d='M8 2a1 1 0 000 2h2a1 1 0 100-2H8z'></path><path d='M3 5a2 2 0 012-2 3 3 0 003 3h2a3 3 0 003-3 2 2 0 012 2v6h-4.586l1.293-1.293a1 1 0 00-1.414-1.414l-3 3a1 1 0 000 1.414l3 3a1 1 0 001.414-1.414L10.414 13H15v3a2 2 0 01-2 2H5a2 2 0 01-2-2V5zM15 11h2a1 1 0 110 2h-2v-2z'></path></svg>
|
||||
</button>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li data-id="5" data-triple="x86_64-unknown-linux-gnu" class="install-content hidden">
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="download-wrapper">
|
||||
<a href="https://github.com/msfjarvis/twt/releases/download/v1.2.4/twt-v1.2.4-x86_64-unknown-linux-gnu.tar.xz">
|
||||
<button class="button primary">
|
||||
<span>Download</span>
|
||||
<span class="button-subtitle">twt-v1.2.4-x86_64-unknown-linux-gnu.tar.xz</span>
|
||||
</button>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<li class="arch hidden" data-arch="x86_64-apple-darwin">
|
||||
|
||||
<ul class="tabs">
|
||||
|
||||
|
||||
|
||||
<li class="install-tab" data-id="2" data-triple="x86_64-apple-darwin">
|
||||
shell
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li class="install-tab" data-id="0" data-triple="x86_64-apple-darwin">
|
||||
nix flakes
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li class="install-tab" data-id="3" data-triple="x86_64-apple-darwin">
|
||||
tarball
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
<ul class="contents">
|
||||
|
||||
|
||||
<li data-id="2" data-triple="x86_64-apple-darwin" class="install-content">
|
||||
|
||||
|
||||
<div class="install-code-wrapper">
|
||||
<pre style="background-color:#263238;">
|
||||
<span style="color:#82aaff;">curl</span><span style="color:#89ddff;"> --</span><span style="color:#f78c6c;">proto </span><span style="color:#89ddff;">'</span><span style="color:#c3e88d;">=https</span><span style="color:#89ddff;">' --</span><span style="color:#f78c6c;">tlsv1</span><span style="color:#82aaff;">.2</span><span style="color:#89ddff;"> -</span><span style="color:#f78c6c;">LsSf</span><span style="color:#82aaff;"> https://github.com/msfjarvis/twt/releases/download/v1.2.4/installer.sh </span><span style="color:#89ddff;">| </span><span style="color:#82aaff;">sh</span></pre>
|
||||
|
||||
<button class="button copy-clipboard-button primary" data-copy="curl --proto '=https' --tlsv1.2 -LsSf https://github.com/msfjarvis/twt/releases/download/v1.2.4/installer.sh | sh">
|
||||
<svg stroke='currentColor' fill='currentColor' stroke-width='0' viewBox='0 0 20 20' height='1em' width='1em' xmlns='http://www.w3.org/2000/svg'><path d='M8 2a1 1 0 000 2h2a1 1 0 100-2H8z'></path><path d='M3 5a2 2 0 012-2 3 3 0 003 3h2a3 3 0 003-3 2 2 0 012 2v6h-4.586l1.293-1.293a1 1 0 00-1.414-1.414l-3 3a1 1 0 000 1.414l3 3a1 1 0 001.414-1.414L10.414 13H15v3a2 2 0 01-2 2H5a2 2 0 01-2-2V5zM15 11h2a1 1 0 110 2h-2v-2z'></path></svg>
|
||||
</button>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a class="button primary" href="/twt/installer.sh.txt">Source</a>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li data-id="0" data-triple="x86_64-apple-darwin" class="install-content hidden">
|
||||
|
||||
|
||||
<div class="install-code-wrapper">
|
||||
<pre style="background-color:#263238;">
|
||||
<span style="color:#82aaff;">nix profile install github:msfjarvis/twt</span></pre>
|
||||
|
||||
<button class="button copy-clipboard-button primary" data-copy="nix profile install github:msfjarvis/twt">
|
||||
<svg stroke='currentColor' fill='currentColor' stroke-width='0' viewBox='0 0 20 20' height='1em' width='1em' xmlns='http://www.w3.org/2000/svg'><path d='M8 2a1 1 0 000 2h2a1 1 0 100-2H8z'></path><path d='M3 5a2 2 0 012-2 3 3 0 003 3h2a3 3 0 003-3 2 2 0 012 2v6h-4.586l1.293-1.293a1 1 0 00-1.414-1.414l-3 3a1 1 0 000 1.414l3 3a1 1 0 001.414-1.414L10.414 13H15v3a2 2 0 01-2 2H5a2 2 0 01-2-2V5zM15 11h2a1 1 0 110 2h-2v-2z'></path></svg>
|
||||
</button>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li data-id="3" data-triple="x86_64-apple-darwin" class="install-content hidden">
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="download-wrapper">
|
||||
<a href="https://github.com/msfjarvis/twt/releases/download/v1.2.4/twt-v1.2.4-x86_64-apple-darwin.tar.xz">
|
||||
<button class="button primary">
|
||||
<span>Download</span>
|
||||
<span class="button-subtitle">twt-v1.2.4-x86_64-apple-darwin.tar.xz</span>
|
||||
</button>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<li class="arch hidden" data-arch="aarch64-apple-darwin">
|
||||
|
||||
<ul class="tabs">
|
||||
|
||||
|
||||
|
||||
<li class="install-tab" data-id="2" data-triple="aarch64-apple-darwin">
|
||||
shell
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li class="install-tab" data-id="0" data-triple="aarch64-apple-darwin">
|
||||
nix flakes
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
<ul class="contents">
|
||||
|
||||
|
||||
<li data-id="2" data-triple="aarch64-apple-darwin" class="install-content">
|
||||
|
||||
|
||||
<div class="install-code-wrapper">
|
||||
<pre style="background-color:#263238;">
|
||||
<span style="color:#82aaff;">curl</span><span style="color:#89ddff;"> --</span><span style="color:#f78c6c;">proto </span><span style="color:#89ddff;">'</span><span style="color:#c3e88d;">=https</span><span style="color:#89ddff;">' --</span><span style="color:#f78c6c;">tlsv1</span><span style="color:#82aaff;">.2</span><span style="color:#89ddff;"> -</span><span style="color:#f78c6c;">LsSf</span><span style="color:#82aaff;"> https://github.com/msfjarvis/twt/releases/download/v1.2.4/installer.sh </span><span style="color:#89ddff;">| </span><span style="color:#82aaff;">sh</span></pre>
|
||||
|
||||
<button class="button copy-clipboard-button primary" data-copy="curl --proto '=https' --tlsv1.2 -LsSf https://github.com/msfjarvis/twt/releases/download/v1.2.4/installer.sh | sh">
|
||||
<svg stroke='currentColor' fill='currentColor' stroke-width='0' viewBox='0 0 20 20' height='1em' width='1em' xmlns='http://www.w3.org/2000/svg'><path d='M8 2a1 1 0 000 2h2a1 1 0 100-2H8z'></path><path d='M3 5a2 2 0 012-2 3 3 0 003 3h2a3 3 0 003-3 2 2 0 012 2v6h-4.586l1.293-1.293a1 1 0 00-1.414-1.414l-3 3a1 1 0 000 1.414l3 3a1 1 0 001.414-1.414L10.414 13H15v3a2 2 0 01-2 2H5a2 2 0 01-2-2V5zM15 11h2a1 1 0 110 2h-2v-2z'></path></svg>
|
||||
</button>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a class="button primary" href="/twt/installer.sh.txt">Source</a>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li data-id="0" data-triple="aarch64-apple-darwin" class="install-content hidden">
|
||||
|
||||
|
||||
<div class="install-code-wrapper">
|
||||
<pre style="background-color:#263238;">
|
||||
<span style="color:#82aaff;">nix profile install github:msfjarvis/twt</span></pre>
|
||||
|
||||
<button class="button copy-clipboard-button primary" data-copy="nix profile install github:msfjarvis/twt">
|
||||
<svg stroke='currentColor' fill='currentColor' stroke-width='0' viewBox='0 0 20 20' height='1em' width='1em' xmlns='http://www.w3.org/2000/svg'><path d='M8 2a1 1 0 000 2h2a1 1 0 100-2H8z'></path><path d='M3 5a2 2 0 012-2 3 3 0 003 3h2a3 3 0 003-3 2 2 0 012 2v6h-4.586l1.293-1.293a1 1 0 00-1.414-1.414l-3 3a1 1 0 000 1.414l3 3a1 1 0 001.414-1.414L10.414 13H15v3a2 2 0 01-2 2H5a2 2 0 01-2-2V5zM15 11h2a1 1 0 110 2h-2v-2z'></path></svg>
|
||||
</button>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<li class="arch hidden" data-arch="x86_64-pc-windows-msvc">
|
||||
|
||||
<ul class="tabs">
|
||||
|
||||
|
||||
|
||||
<li class="install-tab" data-id="1" data-triple="x86_64-pc-windows-msvc">
|
||||
powershell
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li class="install-tab" data-id="0" data-triple="x86_64-pc-windows-msvc">
|
||||
nix flakes
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li class="install-tab" data-id="4" data-triple="x86_64-pc-windows-msvc">
|
||||
zip
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
<ul class="contents">
|
||||
|
||||
|
||||
<li data-id="1" data-triple="x86_64-pc-windows-msvc" class="install-content">
|
||||
|
||||
|
||||
<div class="install-code-wrapper">
|
||||
<pre style="background-color:#263238;">
|
||||
<span style="color:#82aaff;">irm https://github.com/msfjarvis/twt/releases/download/v1.2.4/installer.ps1 </span><span style="color:#89ddff;">| </span><span style="color:#82aaff;">iex</span></pre>
|
||||
|
||||
<button class="button copy-clipboard-button primary" data-copy="irm https://github.com/msfjarvis/twt/releases/download/v1.2.4/installer.ps1 | iex">
|
||||
<svg stroke='currentColor' fill='currentColor' stroke-width='0' viewBox='0 0 20 20' height='1em' width='1em' xmlns='http://www.w3.org/2000/svg'><path d='M8 2a1 1 0 000 2h2a1 1 0 100-2H8z'></path><path d='M3 5a2 2 0 012-2 3 3 0 003 3h2a3 3 0 003-3 2 2 0 012 2v6h-4.586l1.293-1.293a1 1 0 00-1.414-1.414l-3 3a1 1 0 000 1.414l3 3a1 1 0 001.414-1.414L10.414 13H15v3a2 2 0 01-2 2H5a2 2 0 01-2-2V5zM15 11h2a1 1 0 110 2h-2v-2z'></path></svg>
|
||||
</button>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a class="button primary" href="/twt/installer.ps1.txt">Source</a>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li data-id="0" data-triple="x86_64-pc-windows-msvc" class="install-content hidden">
|
||||
|
||||
|
||||
<div class="install-code-wrapper">
|
||||
<pre style="background-color:#263238;">
|
||||
<span style="color:#82aaff;">nix profile install github:msfjarvis/twt</span></pre>
|
||||
|
||||
<button class="button copy-clipboard-button primary" data-copy="nix profile install github:msfjarvis/twt">
|
||||
<svg stroke='currentColor' fill='currentColor' stroke-width='0' viewBox='0 0 20 20' height='1em' width='1em' xmlns='http://www.w3.org/2000/svg'><path d='M8 2a1 1 0 000 2h2a1 1 0 100-2H8z'></path><path d='M3 5a2 2 0 012-2 3 3 0 003 3h2a3 3 0 003-3 2 2 0 012 2v6h-4.586l1.293-1.293a1 1 0 00-1.414-1.414l-3 3a1 1 0 000 1.414l3 3a1 1 0 001.414-1.414L10.414 13H15v3a2 2 0 01-2 2H5a2 2 0 01-2-2V5zM15 11h2a1 1 0 110 2h-2v-2z'></path></svg>
|
||||
</button>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li data-id="4" data-triple="x86_64-pc-windows-msvc" class="install-content hidden">
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="download-wrapper">
|
||||
<a href="https://github.com/msfjarvis/twt/releases/download/v1.2.4/twt-v1.2.4-x86_64-pc-windows-msvc.zip">
|
||||
<button class="button primary">
|
||||
<span>Download</span>
|
||||
<span class="button-subtitle">twt-v1.2.4-x86_64-pc-windows-msvc.zip</span>
|
||||
</button>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="no-autodetect hidden">
|
||||
<span class="no-autodetect-details">We weren't able to detect your OS.</span>
|
||||
</div>
|
||||
<noscript>
|
||||
<a href="/twt/artifacts/">View all installation options</a>
|
||||
</noscript>
|
||||
|
||||
<div class="mac-switch hidden">This project doesn't offer Apple Silicon downloads, but you can run Intel macOS binaries via Rosetta 2.</div>
|
||||
|
||||
|
||||
|
||||
<div class="bottom-options ">
|
||||
<a href="/twt/artifacts/" class="backup-download primary">View all installation options</a>
|
||||
|
||||
<div class="arch-select hidden">
|
||||
<select id="install-arch-select">
|
||||
<option disabled="true" selected="true" value=""></option>
|
||||
|
||||
<option value="x86_64-unknown-linux-gnu">Linux x64</option>
|
||||
|
||||
<option value="aarch64-apple-darwin">macOS Apple Silicon</option>
|
||||
|
||||
<option value="x86_64-apple-darwin">macOS Intel</option>
|
||||
|
||||
<option value="x86_64-pc-windows-msvc">Windows x64</option>
|
||||
|
||||
</select>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<a href="/twt/artifacts/" class="button mobile-download primary">View all installation options</a>
|
||||
|
||||
<h1>twt <a href="http://unmaintained.tech/" rel="noopener noreferrer"><img src="http://unmaintained.tech/badge.svg" alt="No Maintenance Intended"></a> <a href="https://garnix.io" rel="noopener noreferrer"><img src="https://img.shields.io/static/v1?label=Built%20with&message=Garnix&color=blue&style=flat&logo=nixos&link=https://garnix.io&labelColor=111212" alt="Built with Garnix"></a></h1>
|
||||
<p>CLI tool to extract metadata from tweets</p>
|
||||
<h2>Install</h2>
|
||||
<p>Check out the <a href="https://msfjarvis.github.io/twt/" rel="noopener noreferrer">website</a></p>
|
||||
<h2>Setup</h2>
|
||||
<p>This tool requires Twitter consumer keys to function. Twitter is moving to <a href="https://fxtwitter.com/twitterdev/status/1621026986784337922" rel="noopener noreferrer">disallow free usage of the API</a>, so you will have to steal their own keys to work around this.</p>
|
||||
<p><code>twt</code> picks up keys from <code>$CONFIG_DIR/twt/config.toml</code> (see <a href="https://docs.rs/dirs/latest/dirs/fn.config_dir.html" rel="noopener noreferrer">here</a> for your platform's interpretation of <code>$CONFIG_DIR</code>)</p>
|
||||
<pre style="background-color:#263238;"><span style="font-style:italic;color:#546e7a;"># config.toml
|
||||
</span><span style="color:#f07178;">consumer_key </span><span style="color:#89ddff;">= "</span><span style="color:#c3e88d;">totally_real_key</span><span style="color:#89ddff;">"
|
||||
</span><span style="color:#f07178;">consumer_key_secret </span><span style="color:#89ddff;">= "</span><span style="color:#c3e88d;">h4xx0r</span><span style="color:#89ddff;">"
|
||||
</span></pre>
|
||||
|
||||
<h2>Usage</h2>
|
||||
<h3>Get image links</h3>
|
||||
<pre style="background-color:#263238;"><span style="color:#eeffff;">twt images --username archillect
|
||||
</span></pre>
|
||||
|
||||
<h3>Get video links</h3>
|
||||
<pre style="background-color:#263238;"><span style="color:#eeffff;">twt videos --username imgur
|
||||
</span></pre>
|
||||
|
||||
<h3>Set the maximum tweets to check</h3>
|
||||
<pre style="background-color:#263238;"><span style="color:#eeffff;">twt images --username archillect --max-amount 512
|
||||
</span></pre>
|
||||
|
||||
<h3>Get all links</h3>
|
||||
<pre style="background-color:#263238;"><span style="color:#eeffff;">twt links --username AITA_online --host bit.ly
|
||||
</span></pre>
|
||||
|
||||
<p>For more help run: <code>twt -h</code>.</p>
|
||||
|
||||
|
||||
</main>
|
||||
</div>
|
||||
|
||||
<footer>
|
||||
|
||||
<a href="https://github.com/msfjarvis/twt"><div class="github-icon" aria-hidden="true"></div></a>
|
||||
|
||||
<span>
|
||||
twt, MIT/Apache-2.0
|
||||
</span>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script src="/twt/artifacts.js"></script>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
86
docs/installer.ps1.txt
Normal file
86
docs/installer.ps1.txt
Normal file
|
@ -0,0 +1,86 @@
|
|||
# Licensed under the MIT license
|
||||
# <LICENSE-MIT or https://opensource.org/licenses/MIT>, at your
|
||||
# option. This file may not be copied, modified, or distributed
|
||||
# except according to those terms.
|
||||
|
||||
# This is just a little script that can be downloaded from the internet to
|
||||
# install an app. It downloads the tarball from GitHub releases,
|
||||
# extracts it and runs `??? TODO ???`. This means that you can pass
|
||||
# arguments to this shell script and they will be passed along to the installer.
|
||||
|
||||
$repo = 'https://github.com/msfjarvis/twt'
|
||||
$app_name = 'twt'
|
||||
$package_version = 'v1.2.4'
|
||||
|
||||
function Install-Binary($install_args) {
|
||||
$old_erroractionpreference = $ErrorActionPreference
|
||||
$ErrorActionPreference = 'stop'
|
||||
|
||||
Initialize-Environment
|
||||
|
||||
# If the VERSION env var is set, we use it instead
|
||||
# of the version defined in the cargo.toml
|
||||
$download_version = if (Test-Path env:VERSION) {
|
||||
$Env:VERSION
|
||||
} else {
|
||||
$package_version
|
||||
}
|
||||
|
||||
$exe = Download($download_version)
|
||||
Invoke-Installer "$exe" "$install_args"
|
||||
|
||||
$ErrorActionPreference = $old_erroractionpreference
|
||||
}
|
||||
|
||||
function Download($version) {
|
||||
$url = "$repo/releases/download/$version/$app_name-$version-x86_64-pc-windows-msvc.zip"
|
||||
"Downloading $app_name from $url" | Out-Host
|
||||
$tmp = New-Temp-Dir
|
||||
$dir_path = "$tmp\$app_name.zip"
|
||||
$wc = New-Object Net.Webclient
|
||||
$wc.downloadFile($url, $dir_path)
|
||||
Expand-Archive -Path $dir_path -DestinationPath "$tmp"
|
||||
return "$tmp\$app_name.exe"
|
||||
}
|
||||
|
||||
function Invoke-Installer($tmp, $install_args) {
|
||||
$bin_dir = New-Item -Force -ItemType Directory -Path (Join-Path $HOME ".cargo\bin")
|
||||
Copy-Item "$exe" -Destination "$bin_dir"
|
||||
Remove-Item "$tmp" -Recurse -Force
|
||||
}
|
||||
|
||||
function Initialize-Environment() {
|
||||
If (($PSVersionTable.PSVersion.Major) -lt 5) {
|
||||
Write-Error "PowerShell 5 or later is required to install $app_name."
|
||||
Write-Error "Upgrade PowerShell: https://docs.microsoft.com/en-us/powershell/scripting/setup/installing-windows-powershell"
|
||||
break
|
||||
}
|
||||
|
||||
# show notification to change execution policy:
|
||||
$allowedExecutionPolicy = @('Unrestricted', 'RemoteSigned', 'ByPass')
|
||||
If ((Get-ExecutionPolicy).ToString() -notin $allowedExecutionPolicy) {
|
||||
Write-Error "PowerShell requires an execution policy in [$($allowedExecutionPolicy -join ", ")] to run $app_name."
|
||||
Write-Error "For example, to set the execution policy to 'RemoteSigned' please run :"
|
||||
Write-Error "'Set-ExecutionPolicy RemoteSigned -scope CurrentUser'"
|
||||
break
|
||||
}
|
||||
|
||||
# GitHub requires TLS 1.2
|
||||
If ([System.Enum]::GetNames([System.Net.SecurityProtocolType]) -notcontains 'Tls12') {
|
||||
Write-Error "Installing $app_name requires at least .NET Framework 4.5"
|
||||
Write-Error "Please download and install it first:"
|
||||
Write-Error "https://www.microsoft.com/net/download"
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
function New-Temp-Dir() {
|
||||
[CmdletBinding(SupportsShouldProcess)]
|
||||
param()
|
||||
$parent = [System.IO.Path]::GetTempPath()
|
||||
[string] $name = [System.Guid]::NewGuid()
|
||||
New-Item -ItemType Directory -Path (Join-Path $parent $name)
|
||||
}
|
||||
|
||||
Install-Binary "$Args"
|
||||
|
243
docs/installer.sh.txt
Normal file
243
docs/installer.sh.txt
Normal file
|
@ -0,0 +1,243 @@
|
|||
#!/bin/bash
|
||||
#
|
||||
# Licensed under the MIT license
|
||||
# <LICENSE-MIT or https://opensource.org/licenses/MIT>, at your
|
||||
# option. This file may not be copied, modified, or distributed
|
||||
# except according to those terms.
|
||||
|
||||
# This is just a little script that can be downloaded from the internet to
|
||||
# install $APP_NAME. It downloads the tarball from GitHub releases,
|
||||
# extracts it and runs `???TODO???`. This means that you can pass
|
||||
# arguments to this shell script and they will be passed along to the installer.
|
||||
|
||||
set -u
|
||||
|
||||
REPO="https://github.com/msfjarvis/twt"
|
||||
APP_NAME="twt"
|
||||
BINARY_DOWNLOAD_PREFIX="$REPO/releases/download"
|
||||
PACKAGE_VERSION="v1.2.4"
|
||||
|
||||
download_binary_and_run_installer() {
|
||||
downloader --check
|
||||
need_cmd mktemp
|
||||
need_cmd chmod
|
||||
need_cmd mkdir
|
||||
need_cmd rm
|
||||
need_cmd rmdir
|
||||
need_cmd tar
|
||||
need_cmd which
|
||||
need_cmd dirname
|
||||
need_cmd awk
|
||||
need_cmd cut
|
||||
|
||||
# if $VERSION isn't provided or has 0 length, use version from cargo.toml
|
||||
# ${VERSION:-} checks if version exists, and if doesn't uses the default
|
||||
# which is after the :-, which in this case is empty. -z checks for empty str
|
||||
if [ -z ${VERSION:-} ]; then
|
||||
# VERSION is either not set or empty
|
||||
DOWNLOAD_VERSION=$PACKAGE_VERSION
|
||||
else
|
||||
# VERSION set and not empty
|
||||
DOWNLOAD_VERSION=$VERSION
|
||||
fi
|
||||
|
||||
|
||||
get_architecture || return 1
|
||||
local _arch="$RETVAL"
|
||||
assert_nz "$_arch" "arch"
|
||||
|
||||
local _ext=""
|
||||
local _zip_ext=".tar.xz"
|
||||
case "$_arch" in
|
||||
*windows*)
|
||||
_ext=".exe"
|
||||
_zip_ext=".zip"
|
||||
;;
|
||||
esac
|
||||
|
||||
local _tardir="$APP_NAME-$DOWNLOAD_VERSION-${_arch}"
|
||||
local _url="$BINARY_DOWNLOAD_PREFIX/$DOWNLOAD_VERSION/${_tardir}${_zip_ext}"
|
||||
local _dir="$(mktemp -d 2>/dev/null || ensure mktemp -d -t $APP_NAME)"
|
||||
local _file="$_dir/input.tar.gz"
|
||||
local _bin="$_dir/$APP_NAME$_ext"
|
||||
|
||||
say "downloading $APP_NAME from $_url" 1>&2
|
||||
|
||||
ensure mkdir -p "$_dir"
|
||||
downloader "$_url" "$_file"
|
||||
if [ $? != 0 ]; then
|
||||
say "failed to download $_url"
|
||||
say "this may be a standard network error, but it may also indicate"
|
||||
say "that $APP_NAME's release process is not working. When in doubt"
|
||||
say "please feel free to open an issue!"
|
||||
say "$REPO/issues/new/choose"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
ensure tar xf "$_file" --strip-components 1 -C "$_dir"
|
||||
|
||||
install "$_bin" "$@"
|
||||
|
||||
local _retval=$?
|
||||
|
||||
ignore rm -rf "$_dir"
|
||||
|
||||
return "$_retval"
|
||||
}
|
||||
|
||||
install() {
|
||||
# TODO: REWORK THE INSTALL STEP, THIS IS A JANK HACK
|
||||
|
||||
local _cargo_home_bin="$HOME/.cargo/bin/"
|
||||
local _bin="$1"
|
||||
mkdir -p "$_cargo_home_bin"
|
||||
cp "$_bin" "$_cargo_home_bin"
|
||||
}
|
||||
|
||||
get_architecture() {
|
||||
local _ostype="$(uname -s)"
|
||||
local _cputype="$(uname -m)"
|
||||
|
||||
if [ "$_ostype" = Darwin -a "$_cputype" = i386 ]; then
|
||||
# Darwin `uname -s` lies
|
||||
if sysctl hw.optional.x86_64 | grep -q ': 1'; then
|
||||
local _cputype=x86_64
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$_ostype" = Darwin -a "$_cputype" = arm64 ]; then
|
||||
# Darwin `uname -s` doesn't seem to lie on Big Sur
|
||||
# but the cputype we want is called aarch64, not arm64 (they are equivalent)
|
||||
local _cputype=aarch64
|
||||
fi
|
||||
|
||||
case "$_ostype" in
|
||||
Linux)
|
||||
if has_required_glibc; then
|
||||
local _ostype=unknown-linux-gnu
|
||||
else
|
||||
local _ostype=unknown-linux-musl
|
||||
say "Downloading musl binary that does not include \`rover supergraph compose\`."
|
||||
fi
|
||||
;;
|
||||
|
||||
Darwin)
|
||||
local _ostype=apple-darwin
|
||||
;;
|
||||
|
||||
MINGW* | MSYS* | CYGWIN*)
|
||||
local _ostype=pc-windows-msvc
|
||||
;;
|
||||
|
||||
*)
|
||||
err "no precompiled binaries available for OS: $_ostype"
|
||||
;;
|
||||
esac
|
||||
|
||||
case "$_cputype" in
|
||||
# these are the only two acceptable values for cputype
|
||||
x86_64 | aarch64 )
|
||||
;;
|
||||
*)
|
||||
err "no precompiled binaries available for CPU architecture: $_cputype"
|
||||
|
||||
esac
|
||||
|
||||
local _arch="$_cputype-$_ostype"
|
||||
|
||||
RETVAL="$_arch"
|
||||
}
|
||||
|
||||
say() {
|
||||
local green=`tput setaf 2 2>/dev/null || echo ''`
|
||||
local reset=`tput sgr0 2>/dev/null || echo ''`
|
||||
echo "$1"
|
||||
}
|
||||
|
||||
err() {
|
||||
local red=`tput setaf 1 2>/dev/null || echo ''`
|
||||
local reset=`tput sgr0 2>/dev/null || echo ''`
|
||||
say "${red}ERROR${reset}: $1" >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
has_required_glibc() {
|
||||
local _ldd_version="$(ldd --version 2>&1 | head -n1)"
|
||||
# glibc version string is inconsistent across distributions
|
||||
# instead check if the string does not contain musl (case insensitive)
|
||||
if echo "${_ldd_version}" | grep -iv musl >/dev/null; then
|
||||
local _glibc_version=$(echo "${_ldd_version}" | awk 'NR==1 { print $NF }')
|
||||
local _glibc_major_version=$(echo "${_glibc_version}" | cut -d. -f1)
|
||||
local _glibc_min_version=$(echo "${_glibc_version}" | cut -d. -f2)
|
||||
local _min_major_version=2
|
||||
local _min_minor_version=17
|
||||
if [ "${_glibc_major_version}" -gt "${_min_major_version}" ] \
|
||||
|| { [ "${_glibc_major_version}" -eq "${_min_major_version}" ] \
|
||||
&& [ "${_glibc_min_version}" -ge "${_min_minor_version}" ]; }; then
|
||||
return 0
|
||||
else
|
||||
say "This operating system needs glibc >= ${_min_major_version}.${_min_minor_version}, but only has ${_libc_version} installed."
|
||||
fi
|
||||
else
|
||||
say "This operating system does not support dynamic linking to glibc."
|
||||
fi
|
||||
|
||||
return 1
|
||||
}
|
||||
|
||||
need_cmd() {
|
||||
if ! check_cmd "$1"
|
||||
then err "need '$1' (command not found)"
|
||||
fi
|
||||
}
|
||||
|
||||
check_cmd() {
|
||||
command -v "$1" > /dev/null 2>&1
|
||||
return $?
|
||||
}
|
||||
|
||||
need_ok() {
|
||||
if [ $? != 0 ]; then err "$1"; fi
|
||||
}
|
||||
|
||||
assert_nz() {
|
||||
if [ -z "$1" ]; then err "assert_nz $2"; fi
|
||||
}
|
||||
|
||||
# Run a command that should never fail. If the command fails execution
|
||||
# will immediately terminate with an error showing the failing
|
||||
# command.
|
||||
ensure() {
|
||||
"$@"
|
||||
need_ok "command failed: $*"
|
||||
}
|
||||
|
||||
# This is just for indicating that commands' results are being
|
||||
# intentionally ignored. Usually, because it's being executed
|
||||
# as part of error handling.
|
||||
ignore() {
|
||||
"$@"
|
||||
}
|
||||
|
||||
# This wraps curl or wget. Try curl first, if not installed,
|
||||
# use wget instead.
|
||||
downloader() {
|
||||
if check_cmd curl
|
||||
then _dld=curl
|
||||
elif check_cmd wget
|
||||
then _dld=wget
|
||||
else _dld='curl or wget' # to be used in error message of need_cmd
|
||||
fi
|
||||
|
||||
if [ "$1" = --check ]
|
||||
then need_cmd "$_dld"
|
||||
elif [ "$_dld" = curl ]
|
||||
then curl -sSfL "$1" -o "$2"
|
||||
elif [ "$_dld" = wget ]
|
||||
then wget "$1" -O "$2"
|
||||
else err "Unknown downloader" # should not reach here
|
||||
fi
|
||||
}
|
||||
|
||||
download_binary_and_run_installer "$@" || exit 1
|
||||
|
3
docs/oranda-v0.3.0-prerelease.4.css
Normal file
3
docs/oranda-v0.3.0-prerelease.4.css
Normal file
File diff suppressed because one or more lines are too long
171
flake.lock
171
flake.lock
|
@ -3,11 +3,11 @@
|
|||
"advisory-db": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1669556130,
|
||||
"narHash": "sha256-6qRQVSgpw+Tw17TroiUg8nAte9/KVDH+v30MOOd+pQU=",
|
||||
"lastModified": 1692985935,
|
||||
"narHash": "sha256-hD7PPA9yBJntT5l4H+DGakOGzHaHLyxQhPztoFWbO1E=",
|
||||
"owner": "rustsec",
|
||||
"repo": "advisory-db",
|
||||
"rev": "a66a3049c98395410a2afadf0382882b0a04d8b1",
|
||||
"rev": "d401af5af8e74d61872688d6228d067c553db2c9",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -27,16 +27,14 @@
|
|||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
],
|
||||
"rust-overlay": [
|
||||
"rust-overlay"
|
||||
]
|
||||
"rust-overlay": "rust-overlay"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1669605882,
|
||||
"narHash": "sha256-TiQtL5sUI5rp28S63v+VX25qNjcrc8Xeu+shf3g7Tj4=",
|
||||
"lastModified": 1692750383,
|
||||
"narHash": "sha256-n5P5HOXuu23UB1h9PuayldnRRVQuXJLpoO+xqtMO3ws=",
|
||||
"owner": "ipetkov",
|
||||
"repo": "crane",
|
||||
"rev": "24591d5f8cc979f7b243b88a2d39da09976970ad",
|
||||
"rev": "ef5d11e3c2e5b3924eb0309dba2e1fea2d9062ae",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -45,29 +43,105 @@
|
|||
"type": "github"
|
||||
}
|
||||
},
|
||||
"custom-nixpkgs": {
|
||||
"inputs": {
|
||||
"fenix": [
|
||||
"fenix"
|
||||
],
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
],
|
||||
"rust-manifest": "rust-manifest",
|
||||
"systems": [
|
||||
"systems"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1692917810,
|
||||
"narHash": "sha256-yphwiZk+F221jYQHPNUGAoy/MJI3usdgtzdVG+7oKFY=",
|
||||
"owner": "msfjarvis",
|
||||
"repo": "custom-nixpkgs",
|
||||
"rev": "3b29b3378dc3f5abb36d670ca16aa566ea17a47d",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "msfjarvis",
|
||||
"repo": "custom-nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"devshell": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
],
|
||||
"systems": [
|
||||
"systems"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1692793255,
|
||||
"narHash": "sha256-yVyj0AE280JkccDHuG1XO9oGxN6bW8ksr/xttXcXzK0=",
|
||||
"owner": "numtide",
|
||||
"repo": "devshell",
|
||||
"rev": "2aa26972b951bc05c3632d4e5ae683cb6771a7c6",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "numtide",
|
||||
"repo": "devshell",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"fenix": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
],
|
||||
"rust-analyzer-src": "rust-analyzer-src"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1693030765,
|
||||
"narHash": "sha256-o+eX70uYVU9/Jr79CWDrbmRiClKKNuD395/iBZdzcNM=",
|
||||
"owner": "nix-community",
|
||||
"repo": "fenix",
|
||||
"rev": "e66fa0e97106af71be1b26917fba281a27a653a3",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-community",
|
||||
"repo": "fenix",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-compat": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1668681692,
|
||||
"narHash": "sha256-Ht91NGdewz8IQLtWZ9LCeNXMSXHUss+9COoqu6JLmXU=",
|
||||
"owner": "edolstra",
|
||||
"lastModified": 1688025799,
|
||||
"narHash": "sha256-ktpB4dRtnksm9F5WawoIkEneh1nrEvuxb5lJFt1iOyw=",
|
||||
"owner": "nix-community",
|
||||
"repo": "flake-compat",
|
||||
"rev": "009399224d5e398d03b22badca40a37ac85412a1",
|
||||
"rev": "8bf105319d44f6b9f0d764efa4fdef9f1cc9ba1c",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "edolstra",
|
||||
"owner": "nix-community",
|
||||
"repo": "flake-compat",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-utils": {
|
||||
"inputs": {
|
||||
"systems": [
|
||||
"systems"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1667395993,
|
||||
"narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=",
|
||||
"lastModified": 1692799911,
|
||||
"narHash": "sha256-3eihraek4qL744EvQXsK1Ha6C3CR7nnT8X2qWap4RNk=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f",
|
||||
"rev": "f9e7cf818399d17d347f847525c5a5a8032e4e44",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -78,11 +152,11 @@
|
|||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1669597967,
|
||||
"narHash": "sha256-R+2NaDkXsYkOpFOhmVR8jBZ77Pq55Z6ilaqwFLLn000=",
|
||||
"lastModified": 1693060755,
|
||||
"narHash": "sha256-KNsbfqewEziFJEpPR0qvVz4rx0x6QXxw1CcunRhlFdk=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "be9e3762e719211368d186f547f847737baad720",
|
||||
"rev": "c66ccfa00c643751da2fd9290e096ceaa30493fc",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -96,27 +170,61 @@
|
|||
"inputs": {
|
||||
"advisory-db": "advisory-db",
|
||||
"crane": "crane",
|
||||
"custom-nixpkgs": "custom-nixpkgs",
|
||||
"devshell": "devshell",
|
||||
"fenix": "fenix",
|
||||
"flake-compat": "flake-compat",
|
||||
"flake-utils": "flake-utils",
|
||||
"nixpkgs": "nixpkgs",
|
||||
"rust-overlay": "rust-overlay"
|
||||
"systems": "systems"
|
||||
}
|
||||
},
|
||||
"rust-analyzer-src": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1692775770,
|
||||
"narHash": "sha256-LwoR5N1JHykSte2Ak+Pj/HjJ9fKy9zMJNEftfBJQkLs=",
|
||||
"owner": "rust-lang",
|
||||
"repo": "rust-analyzer",
|
||||
"rev": "f5b7c60ff7a79bfb3e10f3e98c81b7bb4cb53c68",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "rust-lang",
|
||||
"ref": "nightly",
|
||||
"repo": "rust-analyzer",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"rust-manifest": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"narHash": "sha256-emILH39kZmz9D2cquaobdM55EakoGkUxn1sY3r1iYNg=",
|
||||
"type": "file",
|
||||
"url": "https://static.rust-lang.org/dist/2023-07-08/channel-rust-nightly.toml"
|
||||
},
|
||||
"original": {
|
||||
"type": "file",
|
||||
"url": "https://static.rust-lang.org/dist/2023-07-08/channel-rust-nightly.toml"
|
||||
}
|
||||
},
|
||||
"rust-overlay": {
|
||||
"inputs": {
|
||||
"flake-utils": [
|
||||
"crane",
|
||||
"flake-utils"
|
||||
],
|
||||
"nixpkgs": [
|
||||
"crane",
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1669689198,
|
||||
"narHash": "sha256-YsWu3C9IGbH3+xguTzEDyQorFe/igr6FGZ+Q5T2ocxE=",
|
||||
"lastModified": 1691374719,
|
||||
"narHash": "sha256-HCodqnx1Mi2vN4f3hjRPc7+lSQy18vRn8xWW68GeQOg=",
|
||||
"owner": "oxalica",
|
||||
"repo": "rust-overlay",
|
||||
"rev": "4e093ce661a63aca4bcbace33695225eae4ef4e4",
|
||||
"rev": "b520a3889b24aaf909e287d19d406862ced9ffc9",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -124,6 +232,21 @@
|
|||
"repo": "rust-overlay",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"systems": {
|
||||
"locked": {
|
||||
"lastModified": 1687694171,
|
||||
"narHash": "sha256-m4E0xN69qKj/oKOj8OtiZcSFpFlO8paI6E3Wo5oXDJc=",
|
||||
"owner": "msfjarvis",
|
||||
"repo": "flake-systems",
|
||||
"rev": "7876462a5f60841e8b2712ad20dc18470f448e8d",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "msfjarvis",
|
||||
"repo": "flake-systems",
|
||||
"type": "github"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
|
|
160
flake.nix
160
flake.nix
|
@ -1,90 +1,106 @@
|
|||
{
|
||||
description = "twt";
|
||||
|
||||
inputs = {
|
||||
nixpkgs = { url = "github:NixOS/nixpkgs/nixpkgs-unstable"; };
|
||||
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
||||
|
||||
flake-utils = { url = "github:numtide/flake-utils"; };
|
||||
inputs.systems.url = "github:msfjarvis/flake-systems";
|
||||
|
||||
flake-compat = {
|
||||
url = "github:edolstra/flake-compat";
|
||||
flake = false;
|
||||
};
|
||||
inputs.advisory-db.url = "github:rustsec/advisory-db";
|
||||
inputs.advisory-db.flake = false;
|
||||
|
||||
rust-overlay = {
|
||||
url = "github:oxalica/rust-overlay";
|
||||
inputs = {
|
||||
nixpkgs.follows = "nixpkgs";
|
||||
flake-utils.follows = "flake-utils";
|
||||
inputs.crane.url = "github:ipetkov/crane";
|
||||
inputs.crane.inputs.flake-compat.follows = "flake-compat";
|
||||
inputs.crane.inputs.flake-utils.follows = "flake-utils";
|
||||
inputs.crane.inputs.nixpkgs.follows = "nixpkgs";
|
||||
|
||||
inputs.custom-nixpkgs.url = "github:msfjarvis/custom-nixpkgs";
|
||||
inputs.custom-nixpkgs.inputs.nixpkgs.follows = "nixpkgs";
|
||||
inputs.custom-nixpkgs.inputs.fenix.follows = "fenix";
|
||||
inputs.custom-nixpkgs.inputs.systems.follows = "systems";
|
||||
|
||||
inputs.devshell.url = "github:numtide/devshell";
|
||||
inputs.devshell.inputs.nixpkgs.follows = "nixpkgs";
|
||||
inputs.devshell.inputs.systems.follows = "systems";
|
||||
|
||||
inputs.fenix.url = "github:nix-community/fenix";
|
||||
inputs.fenix.inputs.nixpkgs.follows = "nixpkgs";
|
||||
|
||||
inputs.flake-utils.url = "github:numtide/flake-utils";
|
||||
inputs.flake-utils.inputs.systems.follows = "systems";
|
||||
|
||||
inputs.flake-compat.url = "github:nix-community/flake-compat";
|
||||
inputs.flake-compat.flake = false;
|
||||
|
||||
outputs = {
|
||||
self,
|
||||
nixpkgs,
|
||||
advisory-db,
|
||||
crane,
|
||||
custom-nixpkgs,
|
||||
devshell,
|
||||
fenix,
|
||||
flake-utils,
|
||||
...
|
||||
}:
|
||||
flake-utils.lib.eachDefaultSystem (system: let
|
||||
pkgs = import nixpkgs {
|
||||
inherit system;
|
||||
overlays = [custom-nixpkgs.overlays.default devshell.overlays.default];
|
||||
};
|
||||
};
|
||||
|
||||
crane = {
|
||||
url = "github:ipetkov/crane";
|
||||
inputs = {
|
||||
flake-compat.follows = "flake-compat";
|
||||
flake-utils.follows = "flake-utils";
|
||||
nixpkgs.follows = "nixpkgs";
|
||||
rust-overlay.follows = "rust-overlay";
|
||||
rustStable = (import fenix {inherit pkgs;}).fromToolchainFile {
|
||||
file = ./rust-toolchain.toml;
|
||||
sha256 = "sha256-Q9UgzzvxLi4x9aWUJTn+/5EXekC98ODRU1TwhUs9RnY=";
|
||||
};
|
||||
};
|
||||
|
||||
advisory-db = {
|
||||
url = "github:rustsec/advisory-db";
|
||||
flake = false;
|
||||
};
|
||||
};
|
||||
craneLib = (crane.mkLib pkgs).overrideToolchain rustStable;
|
||||
commonArgs = {
|
||||
src = craneLib.cleanCargoSource ./.;
|
||||
buildInputs = [];
|
||||
nativeBuildInputs = [];
|
||||
cargoClippyExtraArgs = "--all-targets -- --deny warnings";
|
||||
};
|
||||
cargoArtifacts = craneLib.buildDepsOnly (commonArgs // {doCheck = false;});
|
||||
|
||||
outputs =
|
||||
{ self, nixpkgs, crane, flake-utils, advisory-db, rust-overlay, ... }:
|
||||
flake-utils.lib.eachDefaultSystem (system:
|
||||
let
|
||||
pkgs = import nixpkgs {
|
||||
inherit system;
|
||||
overlays = [ (import rust-overlay) ];
|
||||
};
|
||||
|
||||
rustStable =
|
||||
pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml;
|
||||
craneLib = (crane.mkLib pkgs).overrideToolchain rustStable;
|
||||
src = ./.;
|
||||
cargoArtifacts = craneLib.buildDepsOnly { inherit src buildInputs; };
|
||||
buildInputs = [ ];
|
||||
|
||||
twt = craneLib.buildPackage {
|
||||
inherit src;
|
||||
doCheck = false;
|
||||
};
|
||||
twt-clippy = craneLib.cargoClippy {
|
||||
inherit cargoArtifacts src buildInputs;
|
||||
cargoClippyExtraArgs = "--all-targets -- --deny warnings";
|
||||
};
|
||||
twt-fmt = craneLib.cargoFmt { inherit src; };
|
||||
twt-audit = craneLib.cargoAudit { inherit src advisory-db; };
|
||||
twt-nextest = craneLib.cargoNextest {
|
||||
inherit cargoArtifacts src buildInputs;
|
||||
twt = craneLib.buildPackage (commonArgs // {doCheck = false;});
|
||||
twt-clippy = craneLib.cargoClippy (commonArgs
|
||||
// {
|
||||
inherit cargoArtifacts;
|
||||
});
|
||||
twt-fmt = craneLib.cargoFmt (commonArgs // {});
|
||||
twt-audit = craneLib.cargoAudit (commonArgs // {inherit advisory-db;});
|
||||
twt-nextest = craneLib.cargoNextest (commonArgs
|
||||
// {
|
||||
inherit cargoArtifacts;
|
||||
partitions = 1;
|
||||
partitionType = "count";
|
||||
};
|
||||
in {
|
||||
checks = {
|
||||
# TODO: Switch to cargo-audit and re-enable this
|
||||
# twt-audit
|
||||
inherit twt twt-clippy twt-fmt twt-nextest;
|
||||
};
|
||||
});
|
||||
in {
|
||||
checks = {
|
||||
inherit twt twt-audit twt-clippy twt-fmt twt-nextest;
|
||||
};
|
||||
|
||||
packages.default = twt;
|
||||
packages.default = twt;
|
||||
|
||||
apps.default = flake-utils.lib.mkApp { drv = twt; };
|
||||
apps.default = flake-utils.lib.mkApp {drv = twt;};
|
||||
|
||||
devShells.default = pkgs.mkShell {
|
||||
inputsFrom = builtins.attrValues self.checks;
|
||||
devShells.default = pkgs.devshell.mkShell {
|
||||
bash = {interactive = "";};
|
||||
|
||||
nativeBuildInputs = with pkgs; [
|
||||
cargo-nextest
|
||||
cargo-release
|
||||
rustStable
|
||||
];
|
||||
};
|
||||
});
|
||||
env = [
|
||||
{
|
||||
name = "DEVSHELL_NO_MOTD";
|
||||
value = 1;
|
||||
}
|
||||
];
|
||||
|
||||
packages = with pkgs; [
|
||||
cargo-dist-unstable
|
||||
cargo-nextest
|
||||
cargo-release
|
||||
oranda
|
||||
rustStable
|
||||
];
|
||||
};
|
||||
});
|
||||
}
|
||||
|
|
16
oranda.json
Normal file
16
oranda.json
Normal file
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
"build": {
|
||||
"path_prefix": "twt",
|
||||
"dist_dir": "./docs"
|
||||
},
|
||||
"components": {
|
||||
"artifacts": {
|
||||
"cargo_dist": true,
|
||||
"package_managers": {
|
||||
"preferred": {
|
||||
"nix flakes": "nix profile install github:msfjarvis/twt"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
[toolchain]
|
||||
channel = "stable"
|
||||
components = [ "clippy", "rustfmt", "rust-src" ]
|
||||
targets = [ "x86_64-unknown-linux-gnu" ]
|
||||
channel = "1.72.0"
|
||||
components = ["clippy", "rustfmt", "rust-src"]
|
||||
targets = ["x86_64-unknown-linux-gnu"]
|
||||
profile = "minimal"
|
||||
|
|
14
shell.nix
14
shell.nix
|
@ -1,6 +1,8 @@
|
|||
(import (let lock = builtins.fromJSON (builtins.readFile ./flake.lock);
|
||||
in fetchTarball {
|
||||
url =
|
||||
"https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz";
|
||||
sha256 = lock.nodes.flake-compat.locked.narHash;
|
||||
}) { src = ./.; }).shellNix
|
||||
(import (let
|
||||
lock = builtins.fromJSON (builtins.readFile ./flake.lock);
|
||||
in
|
||||
fetchTarball {
|
||||
url = "https://github.com/nix-community/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz";
|
||||
sha256 = lock.nodes.flake-compat.locked.narHash;
|
||||
}) {src = ./.;})
|
||||
.shellNix
|
||||
|
|
|
@ -30,6 +30,7 @@ pub enum Commands {
|
|||
Images(Images),
|
||||
#[command(arg_required_else_help = true)]
|
||||
Links(Links),
|
||||
#[cfg(feature = "videos")]
|
||||
#[command(arg_required_else_help = true)]
|
||||
Videos(Videos),
|
||||
}
|
||||
|
@ -83,6 +84,7 @@ impl TimelineCreator for Links {
|
|||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "videos")]
|
||||
#[derive(Debug, Args)]
|
||||
/// Fetch high quality versions of videos embedded in the user's tweets.
|
||||
pub struct Videos {
|
||||
|
@ -90,6 +92,7 @@ pub struct Videos {
|
|||
opts: CommonCliOpts,
|
||||
}
|
||||
|
||||
#[cfg(feature = "videos")]
|
||||
impl TimelineCreator for Videos {
|
||||
fn timeline(&self, token: Token) -> Timeline {
|
||||
self.create_timeline(&self.opts, token)
|
||||
|
@ -102,6 +105,6 @@ mod test {
|
|||
|
||||
#[test]
|
||||
fn cli_assert() {
|
||||
<Opts as clap::CommandFactory>::command().debug_assert()
|
||||
<Opts as clap::CommandFactory>::command().debug_assert();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,6 +6,8 @@ use url::Url;
|
|||
|
||||
const ACCEPTED_MIME_TYPES: [Mime; 2] = [mime::IMAGE_JPEG, mime::IMAGE_PNG];
|
||||
|
||||
// `feed` is passed over into two separate methods which consume the value fully.
|
||||
#[allow(clippy::needless_pass_by_value)]
|
||||
pub fn invoke(feed: Iter<Tweet>) {
|
||||
let filter = |url: &Url| {
|
||||
return if let Some(segment) = url.path().split('/').last() {
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
pub mod images;
|
||||
pub mod links;
|
||||
#[cfg(feature = "videos")]
|
||||
pub mod videos;
|
||||
|
||||
use egg_mode::tweet::Tweet;
|
||||
|
|
|
@ -1,14 +1,12 @@
|
|||
use std::path::PathBuf;
|
||||
|
||||
use color_eyre::{eyre::eyre, Result};
|
||||
use serde::Deserialize;
|
||||
use serde_derive::Deserialize;
|
||||
|
||||
#[derive(Deserialize)]
|
||||
pub struct Credentials {
|
||||
pub consumer_key: String,
|
||||
pub consumer_key_secret: String,
|
||||
pub access_token: String,
|
||||
pub access_token_secret: String,
|
||||
}
|
||||
|
||||
pub fn get_path() -> Result<PathBuf> {
|
||||
|
|
11
src/main.rs
11
src/main.rs
|
@ -3,12 +3,13 @@ mod cmds;
|
|||
mod config;
|
||||
|
||||
use crate::cli::{Commands, Opts, TimelineCreator};
|
||||
use crate::cmds::{images, links, videos};
|
||||
#[cfg(feature = "videos")]
|
||||
use crate::cmds::videos;
|
||||
use crate::cmds::{images, links};
|
||||
use crate::config::Credentials;
|
||||
use clap::Parser;
|
||||
use color_eyre::Result;
|
||||
use egg_mode::KeyPair;
|
||||
use egg_mode::Token::Access;
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() -> Result<()> {
|
||||
|
@ -17,9 +18,8 @@ async fn main() -> Result<()> {
|
|||
let credentials: Credentials = toml::from_str(&config_str)?;
|
||||
let options = Opts::parse();
|
||||
|
||||
let consumer = KeyPair::new(credentials.consumer_key, credentials.consumer_key_secret);
|
||||
let access = KeyPair::new(credentials.access_token, credentials.access_token_secret);
|
||||
let token = Access { consumer, access };
|
||||
let con_token = KeyPair::new(credentials.consumer_key, credentials.consumer_key_secret);
|
||||
let token = egg_mode::auth::bearer_token(&con_token).await?;
|
||||
|
||||
match options.command {
|
||||
Commands::Images(opts) => {
|
||||
|
@ -35,6 +35,7 @@ async fn main() -> Result<()> {
|
|||
let feed = feed.iter();
|
||||
links::invoke(feed, &host);
|
||||
}
|
||||
#[cfg(feature = "videos")]
|
||||
Commands::Videos(opts) => {
|
||||
let timeline = opts.timeline(token);
|
||||
let (_, feed) = timeline.start().await?;
|
||||
|
|
Loading…
Reference in New Issue
Block a user