# Create a Twython object using dev app keys and tokens
twitter = Twython(APP_KEY, APP_SECRET, OAUTH_TOKEN, OAUTH_TOKEN_SECRET)

# Get all previous tweets using the REST API

#recent_tweets = ['I love you', 'I hate you']
recent_tweets = []
timeline = twitter.get_user_timeline()
for line in timeline:
  tweet = line['text'].encode('utf-8')
  recent_tweets.append(tweet)

# Calculate current sentiment score
for tweet in recent_tweets:
  sentimentScore += happyCalc.signTweet(tweet)
print 'Sentiment of past tweets = ' + str(sentimentScore)

# Create a streamer object
streamer = MyTwythonStreamer(APP_KEY, APP_SECRET, OAUTH_TOKEN, OAUTH_TOKEN_SECRET)

streamer.add_tweets(recent_tweets)
streamer.print_tweets()

counter = 1
while (counter < 3):
  # Pass in your twitter id within the follow paramater to stream a specific user.
  #streamer.statuses.filter(follow = )
  #streamer.user()

  counter += 1