Skip to content

Instantly share code, notes, and snippets.

@myouju
Last active January 22, 2016 05:22
Show Gist options
  • Save myouju/03199c971988a07a75f0 to your computer and use it in GitHub Desktop.
Save myouju/03199c971988a07a75f0 to your computer and use it in GitHub Desktop.
スピリチュアルエンジニアリング
# -*- coding: utf-8 -*-
import urllib
import urllib2
import unirest
API_URL="https://dateinfoapi.appspot.com/v1"
hubot_url = ""
rid = ""
if __name__ == "__main__":
response = unirest.get(API_URL)
rokuyo = response.body['rokuyo'].encode('utf-8')
text = "今日は"+rokuyo+"だよ"
params = {"rid": rid, "text":text}
params = urllib.urlencode(params)
req = urllib2.Request(cw_url)
req.add_data(params)
res = urllib2.urlopen(req)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment