Skip to content

Commit

Permalink
Normalized dict for status entities
Browse files Browse the repository at this point in the history
  • Loading branch information
satanas committed Nov 20, 2011
1 parent a0da7c8 commit 79a817f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
7 changes: 6 additions & 1 deletion libturpial/api/interfaces/protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,12 @@ def get_int_time(self, strdate):
return time.mktime(t)

def get_entities(self, status):
entities = {}
entities = {
'urls': [],
'hashtags': [],
'mentions': [],
'groups': [],
}
text = status['text']

urls = []
Expand Down
7 changes: 6 additions & 1 deletion libturpial/api/protocols/twitter/twitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,12 @@ def auth(self, username, password):

def get_entities(self, tweet):
if tweet.has_key('entities'):
entities = {}
entities = {
'urls': [],
'hashtags': [],
'mentions': [],
'groups': [],
}
mentions = []
for mention in tweet['entities']['user_mentions']:
mentions.append('@'+mention['screen_name'])
Expand Down

0 comments on commit 79a817f

Please sign in to comment.