Exemplo n.º 1
0
    def __init__(self, d):
        status = dict(d)
        self.data = status
        
        if "delete" in status: return
        
        self.created_at = twittertime(status["created_at"])
        
        for i in ("id", "in_reply_to_status_id",
                  "in_reply_to_user_id"):
            setattr(self, i, int(status[i]) \
                        if status[i] != None else None)
        
        for i in ("text", "source", "in_reply_to_screen_name"):
            setattr(self, i, unicode(status[i]) \
                        if status[i] != None else None)
        
        self.source_name = twittersource(self.source)
        
        for i in ("favorited", "truncated"):
            setattr(self, i, status[i])
        
        if "user" in status.keys():
            self.user = user.twuser(status["user"])

        if "retweeted_status" in status.keys():
            self.retweeted_status = twstatus(status["retweeted_status"])
        else:
            self.retweeted_status = None
Exemplo n.º 2
0
 def __init__(self, d):
     user = dict(d)
     self.data = user
     
     for i in ("id", 
               "followers_count", "friends_count", 
               "favourites_count", 
               "utc_offset", "statuses_count"):
         setattr(self, i, int(user[i]) if user[i] != None else None)
     
     for i in ("protected", "following", "verified"):
         setattr(self, i,  user[i])
     
     for i in ("name", "screen_name", "location",
               "description", "profile_image_url",
               "url", "time_zone"):
         setattr(self, i, unicode(user[i]) if user[i] != None else None)
     
     self.created_at = twittertime(user["created_at"])
     
     if "status" in user.keys():
         self.status = status.twstatus(user["status"])
Exemplo n.º 3
0
 def created_at(self): return twittertime(self.get("created_at"))
 
 @property