-
Notifications
You must be signed in to change notification settings - Fork 1
/
tweet.py
executable file
·32 lines (25 loc) · 881 Bytes
/
tweet.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyleft © 2016 danielamorais <danielamorais@tars>
#
# Distributed under terms of the GNU GPL license.
from twython import Twython
from flask import Flask
import apiConfig
app = Flask(__name__)
APP_KEY = apiConfig.APP_KEY # Customer Key here
APP_SECRET = apiConfig.APP_SECRET # Customer secret here
OAUTH_TOKEN = apiConfig.OAUTH_TOKEN # Access Token here
OAUTH_TOKEN_SECRET = apiConfig.OAUTH_TOKEN_SECRET # Access Token Secret here
twitter = Twython(APP_KEY, APP_SECRET, OAUTH_TOKEN, OAUTH_TOKEN_SECRET)
@app.route("/")
def index():
return "Hello"
@app.route("/sendTweet/<message>")
def sendTweet(message):
twitter.update_status(status=message); #you can check twitter to see your tweet live
return "Done."
if __name__ == '__main__':
app.run(host="127.0.0.1", port=8080, debug=True)