示例#1
0
# Currently, this app only goes for ten words. And it doesn't use the word frequencies at all.
# Those would be two great additions, for anyone that wants to improve the app! :)
#
#
# 4. GENERATING A SENTENCE
#
# Next up, we have the markov chain. To generate our tweet (in a process just like what I
# showed above, you use the function...
#
#   "thinkOfASentence()" -> this returns back a sentence, so make sure you save it into
#   a variable like so.... "sentence = thinkOfASentence()"
#
# 5. TWEET IT
#
# We Tweet using "Tweepy" -- a Python plugin that uses Twitter's API. Tweet by running:
#
#               tweet(sentence)
#
# where the sentence is any string you want to tweet. Remember that Twitter limits its
# Tweets to 140 characters.
#
# - danny

print 'starting\n'

while True:
    sentence = thinkOfASentence()  # make wisdom
    tweet(sentence)  # tweet it
    time.sleep(600)  # sleep for ten minutes

print 'loop ended. shouldn\'t happen.\n'
示例#2
0
# We Tweet using "Tweepy" -- a Python plugin that uses Twitter's API. Tweet by running:
#
#               tweet(sentence)
#
# where the sentence is any string you want to tweet. Remember that Twitter limits its
# Tweets to 140 characters.
#
# - danny

# getAllTweets('loganfreedman')
# cleanTweets()
# makeMarkovChain()

print 'start'

sentence = thinkOfASentence()

print 'sentence is ' + sentence

tweet('LOGAN TWEET: ' + sentence)

print 'finish'

# print 'starting\n'

# while True:
#    sentence = thinkOfASentence() # make wisdom
#    tweet(sentence) # tweet it
#    time.sleep(600) # sleep for ten minutes

# print 'loop ended. shouldn\'t happen.\n'
示例#3
0
#
#
# 4. GENERATING A SENTENCE
#
# Next up, we have the markov chain. To generate our tweet (in a process just like what I
# showed above, you use the function...
#
#   "thinkOfASentence()" -> this returns back a sentence, so make sure you save it into
#   a variable like so.... "sentence = thinkOfASentence()"
#
# 5. TWEET IT
#
# We Tweet using "Tweepy" -- a Python plugin that uses Twitter's API. Tweet by running:
#
#               tweet(sentence)
#
# where the sentence is any string you want to tweet. Remember that Twitter limits its
# Tweets to 140 characters.
#
# - danny



print 'starting\n'

while True:
    sentence = thinkOfASentence() # make wisdom
    tweet(sentence) # tweet it
    time.sleep(600) # sleep for ten minutes

print 'loop ended. shouldn\'t happen.\n'