コード例 #1
0
 def test_VerifyCredentials(self):
     api = twitter(t.CONSUMER_KEY, t.CONSUMER_SECRET, t.ACCESS_KEY, t.ACCESS_SECRET)
     status = api.VerifyCredentials()
     self.assertIsNotNone(status)
     self.assertTrue('screen_name' in status)
     self.assertTrue('name' in status)
コード例 #2
0
def getfriends():
    tapi = twitter(t.CONSUMER_KEY, t.CONSUMER_SECRET, t.ACCESS_KEY,
                   t.ACCESS_SECRET)
    friends = tapi.GetFriends()
    return json.dumps(friends)
コード例 #3
0
def getwelcomemessages():
    tapi = twitter(t.CONSUMER_KEY, t.CONSUMER_SECRET, t.ACCESS_KEY,
                   t.ACCESS_SECRET)
    welcomemessages = tapi.GetWelcomeMessages()
    return json.dumps(welcomemessages)
コード例 #4
0
def getfollowers():
    tapi = twitter(t.CONSUMER_KEY, t.CONSUMER_SECRET, t.ACCESS_KEY,
                   t.ACCESS_SECRET)
    followers = tapi.GetFollowers()
    return json.dumps(followers)
コード例 #5
0
def timeline():
    screen_name = request.form.get('screenname', 'SanJoseTrails')
    tapi = twitter(t.CONSUMER_KEY, t.CONSUMER_SECRET, t.ACCESS_KEY,
                   t.ACCESS_SECRET)
    timeline = tapi.GetUserTimeline(screen_name=screen_name)
    return jsonify([t['text'] for t in timeline])
コード例 #6
0
def getratelimitstatus():
    tapi = twitter(t.CONSUMER_KEY, t.CONSUMER_SECRET, t.ACCESS_KEY,
                   t.ACCESS_SECRET)
    limitstatus = tapi.GetRateLimitStatus()
    return json.dumps(limitstatus)
コード例 #7
0
def gettrendswoeid():
    tapi = twitter(t.CONSUMER_KEY, t.CONSUMER_SECRET, t.ACCESS_KEY,
                   t.ACCESS_SECRET)
    trendswoeid = tapi.GetTrendsWoeid()
    return json.dumps(trendswoeid)
コード例 #8
0
def getcollections():
    tapi = twitter(t.CONSUMER_KEY, t.CONSUMER_SECRET, t.ACCESS_KEY,
                   t.ACCESS_SECRET)
    collections = tapi.GetCollections()
    return json.dumps(collections)