You are here

jsonデータ取得例

雀士件数

$ curl -sS "https://mahjongsoul.club/JSON/Janshi" | jq '.nodes | length'
61

雀士情報出力

  • 英語の例(language:ja, zh-hans, zh-hant, ko, 指定無しは ja)
$ curl -sS "https://mahjongsoul.club/JSON/Janshi?language=en" | jq '.nodes[].node' | head
{
  "character": "Ichihime",
  "hiragana": "いちひめ",
  "pinyin": "yiji",
  "sex": "female",
  "hight": "154cm",
  "birthday": "Jan 11th",
  "bloodType": "A",
  "voiceActor": "内田真礼",
  "interests": "Food;Sleep",

雀士名

$ curl -sS "https://mahjongsoul.club/JSON/Janshi" | jq '.nodes[].node | select(.categoryitem == "雀士") | .character' | head -5
"一姫"
"二階堂美樹"
"藤田佳奈"
"八木唯"
"九条璃雨"

5 件取得して、雀士名と pinyin 出力

$ curl -sS "https://mahjongsoul.club/JSON/Janshi" | jq -c '[.nodes[].node] | limit(5;.[] | [.character, .pinyin])' 
["一姫","yiji"]
["二階堂美樹","erjietang"]
["藤田佳奈","jianai"]
["三上千織","qianzhi"]
["相原舞","xiangyuanwu"]

"Kaavi" or "KiraraFujimoto"の雀士データ取得、biographyを 20 文字に trim 、フィールド名指定し、CSV 変換して出力

$ curl -sS "https://mahjongsoul.club/JSON/Janshi?language=en" | jq -r '.nodes[].node | select(."character" | contains("Kaavi","KiraraFujimoto")) | .biography |= sub("(?<trimmed>^.{20}).*"; .trimmed + "...") | [.character, .hiragana, .pinyin, .sex, .hight, .birthday, .age, .bloodType, .voiceActor, .interests, .faith, .preferredItem, .released, .colorHex, .biography] | @csv'
"Kaavi","","kawei","female","165cm","Oct 12th","24","A","中原麻衣","Gems;inevitable fate","150","Ordinary Diamond;Large Diamond;Heart of the Ocean","2019-05-31","#A2837F","A mysterious fortune..."
"KiraraFujimoto","ふじもと きらら","tengbenqiluo","female","164cm","Nov 27th","18","B","竹達彩奈","Enjoying makeup;Singing in karaoke","150","Simple Dress;Normal Dress;Gorgeous Dress","2020-08-20","#EBBDB0","In other people eyes..."

雀士を pinyin 指定し、voice 情報取得

  • ex. 一姫 yiji
$ curl -sS "https://mahjongsoul.club/JSON/Voice/yiji?language=en" | jq '.nodes[].node' | tail
  "titleVoice": "SP - Tenpai with Baiman/Sanbaiman",
  "Title": "Ichihime SP - Tenpai with Baiman/Sanbaiman",
  "Body": "Ichihime must tell master, nyaa!",
  "pinyinJyanshi": "yiji",
  "number": "129",
  "categoryVoice_er": "ingame",
  "yaku": "",
  "levelBond": "契約",
  "filevoice": " ingame_beiman.mp3"
}