Skip to content

Commit

Permalink
Merge pull request #4 from privatenumber/develop
Browse files Browse the repository at this point in the history
release
  • Loading branch information
privatenumber authored May 22, 2021
2 parents 42c534f + 9932cea commit fc9f1c5
Show file tree
Hide file tree
Showing 5 changed files with 138 additions and 54 deletions.
Binary file added .github/example-locale-ja.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/example-width-900.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
71 changes: 61 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,44 +1,101 @@
# 📸 snap-tweet
# 📸 snap-tweet <a href="https://npm.im/snap-tweet"><img src="https://badgen.net/npm/v/snap-tweet"></a> <a href="https://packagephobia.now.sh/result?p=snap-tweet"><img src="https://packagephobia.now.sh/badge?p=snap-tweet"></a>

Command-line tool to capture clean and simple tweet snapshots.

<p align="center">
<img src=".github/example.png" width="60%">
<a href="https://twitter.com/jack/status/20">
<img src=".github/example.png" width="60%">
</a>
<br>
<em>Light mode</em>
</p>

<p align="center">
<img src=".github/example-dark.png" width="60%">
<a href="https://twitter.com/jack/status/20">
<img src=".github/example-dark.png" width="60%">
</a>
<br>
<em>Dark mode</em>
</p>

### Features
- 🎛 Adjustable width
- 💅 Rounded corners & transparent background
- 🌚 Dark-mode
- 🌚 Dark mode
- 🌐 Customizable locale
- 🙅‍♀️ No "Share" & "Info" buttons
- 💖 No watermark
- 🔥 Snap multiple tweets at once

<sub>Support this project by ⭐️ starring and sharing it. [Follow me](https://github.com/privatenumber) to see what other cool projects I'm working on! ❤️</sub>

## 🚀 Install
The only requirement is to have [Google Chrome Browser](https://www.google.com/chrome/).


```sh
npm i -g snap-tweet
```

### npx
Use [npx](https://nodejs.dev/learn/the-npx-nodejs-package-runner) to run without installation.
```sh
npx snap-tweet
```

## 🚦 Quick usage
### Basic usage
By default, the tweet snap is opened in your default image viewer so you can decide whether to save or not.
```sh
snap-tweet https://twitter.com/jack/status/20
```

### Save to directory
Save the tweet snap to a specified directory using the `--output-dir` flag.
```sh
snap-tweet https://twitter.com/jack/status/20 --output-dir ~/Desktop
```

### Dark mode
Snap a tweet in dark mode using the `--dark-mode` flag.
```sh
snap-tweet https://twitter.com/jack/status/20 --dark-mode
```

### Custom width
Pass in a custom width for the tweet using the `--width` flag.
```sh
snap-tweet https://twitter.com/github/status/1390807474748416006 --width 900
```

<p align="center">
<a href="https://twitter.com/github/status/1390807474748416006">
<img src=".github/example-width-900.png" width="50%">
</a>
<br>
<em>Tweet with a 900px width</em>
</p>

### Localization
Pass in a [different locale](https://developer.twitter.com/en/docs/twitter-for-websites/supported-languages) using the `--locale` flag.
```sh
snap-tweet https://twitter.com/TwitterJP/status/578707432 --locale ja
```

<p align="center">
<a href="https://twitter.com/TwitterJP/status/578707432">
<img src=".github/example-locale-ja.png" width="50%">
</a>
<br>
<em>Using the Japanese locale (ja)</em>
</p>

### Multiple tweets
Snap multiple tweets at once by passing in multiple tweet URLs.
```sh
snap-tweet https://twitter.com/naval/status/1002103497725173760 https://twitter.com/naval/status/1002103559276478464 https://twitter.com/naval/status/1002103627387813888
```

### Manual
```
snap-tweet
Expand All @@ -54,11 +111,6 @@ Options:
-l, --locale <locale> Locale (default: en)
-h, --help Display this message
-v, --version Display version number
Examples:
$ snap-tweet https://twitter.com/jack/status/20
$ snap-tweet https://twitter.com/TwitterJP/status/578707432 --locale ja
$ snap-tweet https://twitter.com/Interior/status/463440424141459456 --width 900 --dark-mode
```

## 🏋️‍♀️ Motivation
Expand All @@ -77,7 +129,6 @@ So of course, I spent a few hours developing a tool to save us all the headache

_(I know, this is some pretty crazy [yak shaving](https://en.wiktionary.org/wiki/yak_shaving). Checkout [my other projects](https://github.com/privatenumber) to see how deep I've gone.)_


## 🙋‍♀️ Need help?
If you have a question about usage, [ask on Discussions](https://github.com/privatenumber/snap-tweet/discussions).

Expand Down
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
"bin/snap-tweet.js",
"dist"
],
"main": "dist/snap-tweet.js",
"main": "dist/tweet-camera.js",
"bin": "bin/snap-tweet.js",
"scripts": {
"build": "rm -rf dist && tsup src --dts",
"build": "rm -rf dist && tsup src --dts --minify --external '../package.json' --external 'yoga-layout-prebuilt'",
"dev": "esno src/cli.ts",
"lint": "eslint ."
},
Expand All @@ -36,8 +36,7 @@
"*.{js,ts}": "eslint"
},
"dependencies": {
"ink": "^3.0.8",
"react": "^17.0.2"
"yoga-layout-prebuilt": "1.10.0"
},
"devDependencies": {
"@pvtnbr/eslint-config-typescript": "^0.1.16",
Expand All @@ -53,6 +52,8 @@
"lint-staged": "^10.5.4",
"open": "^8.0.7",
"p-retry": "^4.5.0",
"ink": "^3.0.8",
"react": "^16.8.0",
"tempy": "^1.0.1",
"tsup": "^4.10.1",
"typescript": "^4.2.4",
Expand Down
Loading

0 comments on commit fc9f1c5

Please sign in to comment.