LoginSignup
4
4

More than 5 years have passed since last update.

コマンドプロンプトからgvimでマストドンとtwitterに同時に投稿してみよう!

Last updated at Posted at 2017-04-28

必要なソフトウェア

twtyのビルド

go get github.com/mattn/twty
cd go\src\github.com\mattn\twty\
go build
copy twty.exe (%PATH%のとおったフォルダー)

twty は一度起動して、アカウント登録しておくこと

go-mastodon のビルド

go get github.com/mattn/go-mastodon
cd go\src\github.com\mattn\go-mastodon\
go build
cd cmd\mstdn\
go build
copy mstdn.exe (%PATH%のとおったフォルダー)
  • もしかしたら、追加モジュールがいるかもしれないけど、適宜 go get お願いします
  • こちらも、いちど mstdn.exe を起動して、アカウント登録してください

バッチファイル用意

dondon.cmd
@echo off
setlocal
set "DON=%TEMP%\don.txt"
type nul > "%DON%"
gvim -c "e ++enc=utf8" "%DON%"
if errorlevel 1 exit /b
twty -ff "%DON%"
mstdn toot -ff "%DON%"
endlocal

コマンドプロンプトからdondon とタイプすると gvim が起動するので、魂の叫びを書き込もう。登録する時は普通に「:wq」、キャンセルする時は「:cq」だ。文字数超過で twitter への投稿だけが失敗する時もあるから注意な!

4
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
4