How to use the twitterapi.api function in TwitterAPI

To help you get started, we’ve selected a few TwitterAPI examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github hypatia / smilebot / smile.py View on Github external
from twitterapi import api, debuguser, debug
import twitter
import random

followers = api.GetFollowers()
current = random.randint(0, len(followers) - 1)
print followers[current].GetScreenName()

lines = open('phrases').read().splitlines()
myline = random.choice(lines)

if debug:
    api.PostUpdate("@" + debuguser + " current user is " + followers[current].GetScreenName() + " phrase: " + myline)

else:
    api.PostUpdate("@" + followers[current].GetScreenName() + " " + myline)