Skip to content

Instantly share code, notes, and snippets.

@karasugawasu
Last active October 28, 2020 13:01
Show Gist options
  • Save karasugawasu/197ddb42f40230e57e2169322b98baba to your computer and use it in GitHub Desktop.
Save karasugawasu/197ddb42f40230e57e2169322b98baba to your computer and use it in GitHub Desktop.
リモートインスタンスメタ情報取得(it用)

Admin限定

your tokenにadminのtokenを入れないと動かない。

### {
name: "リモートインスタンスメタ情報取得"
version: "0.0.1"
author: "karasu_sue"
description: "themeColorがnullのインスタンスだけメタ情報を取得する(100件)"
}
@update(host) {
Mk:api("admin/federation/refresh-remote-instance-metadata", {
host: host
}, "your token")
<: host
}
@check(){
#instances = {
Mk:api("federation/instances", {
limit: 100,
sort: "+lastCommunicatedAt"
})
}
~~ #h, instances {
? (Obj:get(h, "themeColor") = _ ) {
$host <- Obj:get(h, "host")
update(host)
}
}
}
@main(){
? (Mk:confirm("リモートインスタンスメタ情報取得" "リモートインスタンスメタ情報取得を実行しますか?" "warn") = yes) {
check()
}
}
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment