LoginSignup
1
0

More than 1 year has passed since last update.

診断メーカーから診断結果を取得(Python, Bash)

Last updated at Posted at 2021-07-13

何?

診断メーカーから結果を取得したい

手段

  • 要Session
  • 診断ページに以下のパラメータをPOST:
    • _token: 診断ページから取得
    • shindanName: 任意
      • ここをランダムにするとランダムな結果が得られて楽しい
    • hiddenName: 診断ページから取得
  • 要UA偽装
    • こことかから好きなのを指定する

Python

CLI+ライブラリを書いた。pip install shindan-cliで入る。
https://github.com/eggplants/shindan-cli

  • pythonから:
from shindan_cli import shindan

shindan.shindan(1036646, 'hoge', wait=False)
#=>'ねこって、むしだ。\n\n𝙐𝙉𝙄𝙌𝙇𝙊'
  • CLIから:
$ shindan 1036646 hoge
ねこって、むしだ。

𝙐𝙉𝙄𝙌𝙇𝙊

Bash

Bashスクリプトを書いた。
https://github.com/eggplants/shindan-cli/blob/master/shindan.sh

$ curl -Lo shindan git.io/JDjZ2
$ chmod +x shindan
$ ./shindan 1068122 twst
モハ・・・・・・・・・・・・・・・・・はよっはっはっよっひゃおひゃおおおっはおおんはよはよよよよよよよよよよよよっよよよよよよ
おおおよよンンンンンンン大照
1
0
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
1
0