|
|
@ -120,6 +120,14 @@ class TwitterNetworkData(NetworkData): |
|
|
|
if 'in_reply_to_status_id' in data and data['in_reply_to_status_id']: |
|
|
|
if 'in_reply_to_status_id' in data and data['in_reply_to_status_id']: |
|
|
|
self.parent = int(data['in_reply_to_status_id']) |
|
|
|
self.parent = int(data['in_reply_to_status_id']) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if 'retweeted_status' in data: |
|
|
|
|
|
|
|
self.reposted_by = self.username |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
retweet_user = data['retweeted_status']['user'] |
|
|
|
|
|
|
|
self.name = retweet_user['name'] |
|
|
|
|
|
|
|
self.username = retweet_user['screen_name'] |
|
|
|
|
|
|
|
self.avatar = retweet_user['profile_image_url'] |
|
|
|
|
|
|
|
|
|
|
|
# Twitter encodes a lot of HTML entities, which are not good when |
|
|
|
# Twitter encodes a lot of HTML entities, which are not good when |
|
|
|
# you want to *display* then (e.g., "<" returns to us as "<"). |
|
|
|
# you want to *display* then (e.g., "<" returns to us as "<"). |
|
|
|
# So we convert this here. |
|
|
|
# So we convert this here. |
|
|
@ -267,12 +275,12 @@ class Connection(NetworkBase): |
|
|
|
options.add_option( |
|
|
|
options.add_option( |
|
|
|
group=self.NAMESPACE, |
|
|
|
group=self.NAMESPACE, |
|
|
|
option='server_url', |
|
|
|
option='server_url', |
|
|
|
default='http://twitter.com', |
|
|
|
default='http://api.twitter.com/1', |
|
|
|
is_cmd_option=False) |
|
|
|
is_cmd_option=False) |
|
|
|
options.add_option( |
|
|
|
options.add_option( |
|
|
|
group=self.NAMESPACE, |
|
|
|
group=self.NAMESPACE, |
|
|
|
option='secure_server_url', |
|
|
|
option='secure_server_url', |
|
|
|
default='https://twitter.com', |
|
|
|
default='https://api.twitter.com/1', |
|
|
|
is_cmd_option=False) |
|
|
|
is_cmd_option=False) |
|
|
|
auth_options(self.NAMESPACE, options, self.AUTH) |
|
|
|
auth_options(self.NAMESPACE, options, self.AUTH) |
|
|
|
return |
|
|
|
return |
|
|
@ -332,7 +340,7 @@ class Connection(NetworkBase): |
|
|
|
|
|
|
|
|
|
|
|
def messages(self): |
|
|
|
def messages(self): |
|
|
|
"""Return a list of NetworkData objects for the main "timeline".""" |
|
|
|
"""Return a list of NetworkData objects for the main "timeline".""" |
|
|
|
return self._timeline('last_tweet', '/statuses/friends_timeline.json') |
|
|
|
return self._timeline('last_tweet', '/statuses/home_timeline.json') |
|
|
|
|
|
|
|
|
|
|
|
def message(self, message_id): |
|
|
|
def message(self, message_id): |
|
|
|
"""Retrieves the information of one message.""" |
|
|
|
"""Retrieves the information of one message.""" |
|
|
|