Example #1
0
 def get(self):
     # friend to follower ratio, used to find non-spam followers
     ff_ratio = self.request.get("ratio")
     
     helper = RequestHelper(self)
     t_api = TwitterConnector.new_api()
     
     filtered_followers = ([user_hash(u) for u in t_api.GetFollowers()])
     if ff_ratio:
         filtered_followers = filter(lambda u: u['follower-to-friend-ratio'] > float(ff_ratio), 
             filtered_followers)
         
     followers = sorted_user_list(filtered_followers)
     helper.write_json(followers)
Example #2
0
 def get(self):
     helper = RequestHelper(self)
     t_api = TwitterConnector.new_api()
     friends = sorted_user_list([user_hash(u) for u in t_api.GetFriends()])
     helper.write_json(friends)
Example #3
0
 def get(self, username):
     helper = RequestHelper(self)
     t_api = TwitterConnector.new_api()
     user = t_api.GetUser(username)
     helper.write_json(user_hash(user))