2019-01-30 21:16:16 Python

eew受信用プログラム (Required: IFTTT) https://qiita.com/po

Copy Copied! Full
import os import time from flask import Flask, render_template, request, redirect, url_for import json from requests_oauthlib import OAuth1Session import pprint #デバッグ用 import numpy #今後使用予定..? def button_click(): pygame.mixer.music.stop() window.destroy() twitter = OAuth1Session("APIKey", "API SECRET", "ACCESS TOKEN", "ACCESS TOKEN SECRET") headers = {'content-type': 'application/json; charset=utf-8'} app = Flask(__name__) @app.route('/webhook/http://twitter.com/zishin3255/status/<text>', methods=['GET', 'POST']) def index(text): title = "Hi" it = text.replace("!#http://twitter.com/honkeasari_eew/status/","") params = {"id":it} req = twitter.get("https://api.twitter.com/1.1/statuses/show.json", params = params) timeline = json.loads(req.text) pprint.pprint(timeline) return render_template('./index.html') if __name__ == '__main__': app.debug = False app.run(host='0.0.0.0',port=12345)
eew受信用プログラム (Required: IFTTT)
https://qiita.com/point1reiya/items/5dda0cf9373469504291