Skip to content

Instantly share code, notes, and snippets.

@utahka
Created January 15, 2017 05:04
Show Gist options
  • Save utahka/0da38ddf4cbedfcdc0514f58aa208470 to your computer and use it in GitHub Desktop.
Save utahka/0da38ddf4cbedfcdc0514f58aa208470 to your computer and use it in GitHub Desktop.
#! /usr/bin/env python -O
# -*- encode: utf-8 -*-
import sys
import json
import requests
message_param = sys.argv[1]
apikey_param = "plz set your api key"
url = "https://chatbot-api.userlocal.jp/api/chat?"
params = {
"message": message_param,
"key": apikey_param
}
res = requests.get(url, params=params)
ai_msg = res.json()["result"].encode('utf-8')
print("AI: {0}".format(ai_msg))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment