https://github.com/azu/postem
Cross posting client for twitter, hatebu, and own services.
https://github.com/azu/postem
cross-post electron hatena-bookmark twitter
Last synced: 7 months ago
JSON representation
Cross posting client for twitter, hatebu, and own services.
- Host: GitHub
- URL: https://github.com/azu/postem
- Owner: azu
- License: mit
- Created: 2015-09-26T11:08:47.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2024-05-26T04:59:21.000Z (over 1 year ago)
- Last Synced: 2025-04-15T06:16:18.113Z (7 months ago)
- Topics: cross-post, electron, hatena-bookmark, twitter
- Language: JavaScript
- Homepage:
- Size: 1.51 MB
- Stars: 26
- Watchers: 5
- Forks: 1
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Postem
[Tombloo](https://github.com/to/tombloo)とか[Tombfix](https://github.com/tombfix/core)のようなクロスポストクライアントアプリ。
:memo: Note: このアプリは個人的な用途で作成されているため、バイナリが配布されていません。
そのため、手元のElectron環境で動かす前提の作りになっています。(それを修正するPRは歓迎です)
## Features
- Twitter、はてなブックマークなどへのクロスポスト
- はてなブックマークを使ったタグ補完
- 独自に対応サービスを追加可能
- 入力欄は[textlint](https://github.com/textlint/textlint "textlint")でのリアルタイムLint
- URLスキームを使ってブラウザから起動できる

## Installation
アプリに必要な依存を[Yarn](https://yarnpkg.com/)でインストールします。
yarn install
アプリを起動する前に利用するサービスの設定を`service.js`で定義してください。
## サポートしているサービス
利用するサービスは後述する`service.js`に定義します。
postemリポジトリに実装があるビルトインサポートしているサービスは次の通りです。
- [はてなブックマーク](./src/services/hatebu)
- [Twitter](./src/services/twitter)
- [Slack](./src/services/slack)
- [asocial-bookmark](./src/services/asocial-bookmark)
- [Bluesky](./src/services/bluesky)
- [debug](./src/services/debug)
## 利用するサービスの設定
クロスポストできるサービスの一覧を`service.js`で定義します。
- [src/service.example.js](./src/service.example.js)を`service.js`にリネームして設定
```shell
cp src/service.example.js src/service.js
```
デフォルトでは次のサービスが有効になっています。
- Twitter
- はてなブックマーク
- デバッグ(Development modeのみ有効)
また、[src/services](./src/services)を参考にして独自のサービスを追加できます。
## Usage: 起動方法
Development mode:
yarn start
Production mode: `dist/`ディレクトリにバイナリが出力されます。
yarn run dist
# dist/ にアプリができる
Browser mode: [asocial-bookmark](https://github.com/azu/asocial-bookmark)形式のリポジトリに対応しています。
- `https://postem.netlify.com/?title={TITLE}&url={URL}&github.owner={Owner名}&github.repo={リポジトリ名}&github.ref={refsheads%2Fブランチ名}&github.indexPropertyName={プロパティ名}&github.token={GitHub_Token}`
### 使い方: 投稿
1. 投稿するサービスの選択(アイコンをクリック or ショートカット)
2. タグや説明欄を入力
3. "Submit"で送信(Cmd+Enter)
### 使い方: ショートカット
表示されているアイコンの左から順番にCmd+数字のショートカットが振られています。
- Cmd+1: Twitter
- Cmd+2: はてなブックマーク
最後のアイコンだけはCmd+0が振られています。
### 使い方: コマンドライン引数
次の引数を付けて起動すると初期値が入った状態で起動できます。
- `--title`: set default title
- `--url`: set default url
```
./bin/cmd.js --title "タイトル" --url "https://example.com"
```
### 使い方: URL scheme(production)
URL schemeはproduction modeで作成したバイナリを一度起動しておく必要があります。
起動すると、次のURL schemeが自動的に登録されます。
```
postem://
```
今見ているサイトについて投稿する場合は、次のJavaScriptを実行するとアプリが起動できます。
```
location.href = `postem://?url=${encodeURIComponent(window.top.location.href)}&title=${encodeURIComponent(window.top.document.title)}`
```
## Contributing
1. Fork it!
2. Create your feature branch: `git checkout -b my-new-feature`
3. Commit your changes: `git commit -am 'Add some feature'`
4. Push to the branch: `git push origin my-new-feature`
5. Submit a pull request :D
## License
MIT