90
90
#Get mention entries
91
91
if data["entities"].has_key("user_mentions"):
92
93
for mention in data["entities"]["user_mentions"]:
94
screen_name = mention["screen_name"].lower()
95
startindex = m["content"].lower().index("@" + screen_name) + 1
96
endindex = startindex + len(screen_name)
97
start = m["content"][0:startindex]
98
end = m["content"][endindex:]
99
m["content"] = start + "<a href='gwibber:/user?acct=" + m["account"] + "&name=@" + mention["screen_name"] + "'>" + mention["screen_name"] + "</a>" + end
94
if not mention["screen_name"] in names:
96
m["content"] = m["content"].replace("@" + mention["screen_name"], "@<a href='gwibber:/user?acct=" + m["account"] + "&name=@" + mention["screen_name"] + "'>" + mention["screen_name"] + "</a>")
99
names.append(mention["screen_name"])
103
101
#Get hashtag entities
104
102
if data["entities"].has_key("hashtags"):
105
for tags in data["entities"]["hashtags"]:
108
startindex = m["content"].index("#" + text) + 1
109
endindex = startindex + len(text)
110
start = m["content"][0:startindex]
111
end = m["content"][endindex:]
112
m["content"] = start + "<a href='gwibber:/tag?acct=" + m["account"] + "&query=" + text + "'>" + text + "</a>" + end
104
for tag in data["entities"]["hashtags"]:
105
if not tag["text"] in hashtags:
107
m["content"] = m["content"].replace("#" + tag["text"], "#<a href='gwibber:/tag?acct=" + m["account"] + "&query=#" + tag["text"] + "'>" + tag["text"] + "</a>")
110
hashtags.append(tag["text"])
116
112
# Get url entities - These usually go in the link stream, but if they're picturesor videos, they should go in the proper stream
117
113
if data["entities"].has_key("urls"):