Skip to content

Instantly share code, notes, and snippets.

View mimikun's full-sized avatar
😷
Remember COVID-19

mimikun

😷
Remember COVID-19
View GitHub Profile
@mimikun
mimikun / README.md
Last active July 9, 2017 11:37
admiral_stats_exporter_pythonをスマホ用Python実行環境に入れる方法

admiral_stats_exporter_pythonをPythonista3に入れる方法

前提条件(iOS)

Pythonista3 に StaSh が入っている

インストール方法(iOS Pythonista3)

  1. StaShを起動
  2. git cloneする
@mimikun
mimikun / README.md
Last active July 13, 2017 10:30
README.md
@mimikun
mimikun / image_post_manual.md
Last active May 9, 2018 13:41
MastodonAPIの仕様など

Mastodon API をcURLで叩いてみる

今回実験に使うMastodonインスタンスは自分のインスタンスにしました。 多分他のインスタンスでもやり方は同じだと思います。

まずはアプリケーションを登録しないといけないので登録します。

Mastodon APIの叩き方を見て作業します。

環境

Keybase proof

I hereby claim:

  • I am mimikun on github.
  • I am m1mikun (https://keybase.io/m1mikun) on keybase.
  • I have a public key ASAaZy1gYu3ltcYuXRmp1VgRGkE1K8hztccB1dCfJr0FlAo

To claim this, I am signing this object:

➜ mastodon git:(test/embed) docker-compose logs --tail=100 web
Attaching to mastodon_web_1
web_1 | => Booting Puma
web_1 | => Rails 5.1.4 application starting in production
web_1 | => Run `rails server -h` for more startup options
web_1 | Default type scope order, limit and offset are ignored and will be nullified
web_1 | Creating scope :cache_ids. Overwriting existing method Notification.cache_ids.
web_1 | [5] Puma starting in cluster mode...
web_1 | [5] * Version 3.11.0 (ruby 2.5.0-p0), codename: Love Song
web_1 | [5] * Min threads: 5, max threads: 5
vagrant@mastodon:/vagrant$ bundle exec rails c
Chewy console strategy is `urgent`
Loading development environment (Rails 5.1.4)
[1] pry(main)>
[2] pry(main)> FetchLinkCardService.new.call(Status.find(<c^A$c^A9c^C*c^C3c^B/c^[2] pry(main)> FetchLinkCardService.new.call(Status.find(<c$c9c*c3c/cf
SyntaxError: unexpected '<', expecting ')'
...dService.new.call(Status.find(<c$c9c*c3c/cf
... ^
(eval):2: Invalid char `\x01' in expression
(eval):2: Invalid char `\x01' in expression
@mimikun
mimikun / FetchLinkCardService_result.txt
Last active March 12, 2018 07:50
FetchLinkCardService.new.call(Status.find(99669788764590947))の実行結果
# はじめに
- VPSに入っている自分のインスタンスで動いているコードは、mimikun/masterブランチにあります。
- ローカルにあるmastodon git リポジトリ の git remote -vはこのようになっています。
```
origin git@github.com:mimikun/mastodon.git (fetch)
origin git@github.com:mimikun/mastodon.git (push)
unarist git@github.com:unarist/mastodon.git (fetch)
unarist git@github.com:unarist/mastodon.git (push)
upstream git@github.com:tootsuite/mastodon.git (fetch)
upstream git@github.com:tootsuite/mastodon.git (push)
@mimikun
mimikun / README.md
Last active May 9, 2018 14:23
MastodonでcURL使ってaccess tokenを貰う方法

MastodonでcURL使ってaccess tokenを貰う方法

条件とか

  • 2FAを設定したアカウント
  • Mastodon v2.4.0 rc-1
  • macOS 10.13
  • zsh

いろいろ

Authorization Codeの期限、デフォでは10分なので早く作業する必要がある