Load tweets from text file
This commit is contained in:
parent
6b05119b61
commit
8d7dba548e
8
app.py
8
app.py
|
@ -2,7 +2,11 @@ from flask import *
|
|||
|
||||
app = Flask(__name__)
|
||||
|
||||
tweets = ["test\thttps://example.org/blah.txt\t2018-10-13T23:55:36-04:00\tfuck"]
|
||||
TWEETFILE = "tweets.txt"
|
||||
USERFILE = "users.txt"
|
||||
def get_tweets():
|
||||
with open(TWEETFILE) as f:
|
||||
return "\n".split(f.read())
|
||||
|
||||
@app.route("/")
|
||||
def index():
|
||||
|
@ -10,4 +14,4 @@ def index():
|
|||
|
||||
@app.route("/api/plain/tweets")
|
||||
def tweets_get():
|
||||
return "\n".join(tweets)
|
||||
return "\n".join(get_tweets())
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
test https://example.org/blah.txt 2018-10-13T23:55:36-04:00 fuck
|
Reference in New Issue