Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .DS_Store
Binary file not shown.
1 change: 0 additions & 1 deletion README.md

This file was deleted.

Binary file added credentials.pyc
Binary file not shown.
57 changes: 0 additions & 57 deletions index.html

This file was deleted.

48 changes: 48 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import tweepy
import credentials
from models import UserTree
from flask import Flask, render_template, json


app = Flask(__name__)

auth = tweepy.OAuthHandler(credentials.consumer_key, credentials.consumer_secret)
auth.set_access_token(credentials.access_key, credentials.access_secret)
api = tweepy.API(auth)


p_tweets = api.search("I beat cancer")

accounts = {}


for tweet in p_tweets:
userInstance = UserTree(tweet.author.screen_name, tweet.author.name,
tweet.author.profile_image_url, tweet.text, tweet.author.created_at)
accounts[tweet.author.name] = userInstance
print(tweet.text)

c = p_tweets[0].text

#val = accounts['PJ']
#print(val.tweet_text)

@app.route('/')
def hello_world():
return render_template('index.html')

@app.route('/tree')
def tree_page(value):
val = "Charles"
return '{}'.format(value)

@app.route('/test')
def test():
for val in p_tweets:
g = tree_page(value=val)
return g
return


if __name__ == '__main__':
app.run()
8 changes: 8 additions & 0 deletions models.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
class UserTree:

def __init__(self, name, username, picture, tweet_text, date):
self.name = name
self.username = username
self.picture = picture
self.tweet_text = tweet_text
self.date = date
Binary file added models.pyc
Binary file not shown.
152 changes: 0 additions & 152 deletions styles.css

This file was deleted.

Loading