def convert_message(self, m, isSearch=False): if m.get("retweeted_status") is not None: retweet_user = m.get("user") retweet_count = m.get("retweet_count") id = m.get("id_str") m = m["retweeted_status"] #m["favorited"] = False #なぞだが、RTされたツイートのfavoritedはどうもRTしたユーザのfavoritedが表示されているっぽい。 m["retweet_user"] = retweet_user m["retweet_count"] = retweet_count or 0 m["rt_id"] = m["id_str"] m["id_str"] = id #RTされたツイートのIDは古いため付け替えないと新着チェックロジックでおかしくなる m["id"] = m["id_str"] m["in_reply_to_status_id"] = m.get("in_reply_to_status_id_str") if isSearch: m["is_search"] = True m["user"] = { 'screen_name': m["from_user"], 'profile_image_url': m["profile_image_url"] } m["source"] = unescape(m["source"], {'"': '"'}) m["display_time"] = utils.get_display_time( m["created_at"], "%a, %d %b %Y %H:%M:%S +0000") else: displayTime = utils.get_display_time(m["created_at"], "%a %b %d %H:%M:%S +0000 %Y") m["display_time"] = displayTime return m
def build_entry(self, entry, room_id): entry["display_text"] = utils.escape_html(entry["content"]) entry["display_text"] = utils.replace_link( entry["display_text"], "https://www.youroom.in/r/%s/participations/" % room_id ) displayTime = utils.get_display_time(entry["created_at"], "%Y-%m-%dT%H:%M:%SZ") entry["display_time"] = displayTime return entry
def build_entry(self, entry, room_id): entry["display_text"] = utils.escape_html(entry["content"]) entry["display_text"] = utils.replace_link( entry["display_text"], "https://www.youroom.in/r/%s/participations/" % room_id) displayTime = utils.get_display_time(entry["created_at"], "%Y-%m-%dT%H:%M:%SZ") entry["display_time"] = displayTime return entry
def convert_message(self, m): body = m.get("Body") or m.get("CommentBody") if body: m["display_text"] = utils.escape_html(body) m["display_text"] = utils.replace_link(m["display_text"], "http://www.facebook.com/") time = m.get("LastModifiedDate") if m.get("LastModifiedDate") else m.get("CreatedDate") if time: try: m["display_time"] = utils.get_display_time(time, "%Y-%m-%dT%H:%M:%S.000Z") except: m["display_time"] = utils.get_display_time(time, "%Y-%m-%dT%H:%M:%S.000+0000") if m.get("FeedComments") and m["FeedComments"].get("totalSize") > 0: for c in m["FeedComments"].get("records"): self.convert_message(c) # if m.get("comments") and m["comments"].get("data"): # for c in m["comments"]["data"]: # c = self.convert_message(c) return m
def convert_message(self, m): if m.get("message"): m["display_text"] = utils.escape_html(m.get("message")) m["display_text"] = utils.replace_link(m["display_text"], "http://www.facebook.com/") m["display_time"] = utils.get_display_time(m.get("created_time"), "%Y-%m-%dT%H:%M:%S+0000"); if m.get("comments") and m["comments"].get("data"): for c in m["comments"]["data"]: c = self.convert_message(c) return m
def convert_messages(self, messages, users, threads, account): for m in messages : m["display_text"] = utils.escape_html(m["body"]["plain"]) m["display_text"] = utils.replace_link(m["display_text"], "https://www.yammer.com/%s/users/" % account) displayTime = utils.get_display_time(m["created_at"], "%Y/%m/%d %H:%M:%S +0000") m["display_time"] = displayTime #m["sender"] = self.get_user(account, m["sender_id"]) or m["sender_id"] m["sender"] = users.get(m["sender_id"]) or m["sender_id"] m["refs"] = threads.get(m["id"]) return messages
def convert_message(self, m): if m.get("message"): m["display_text"] = utils.escape_html(m.get("message")) m["display_text"] = utils.replace_link(m["display_text"], "http://www.facebook.com/") m["display_time"] = utils.get_display_time(m.get("created_time"), "%Y-%m-%dT%H:%M:%S+0000") if m.get("comments") and m["comments"].get("data"): for c in m["comments"]["data"]: c = self.convert_message(c) return m
def convert_message(self, m): body = m.get("Body") or m.get("CommentBody") if body: m["display_text"] = utils.escape_html(body) m["display_text"] = utils.replace_link(m["display_text"], "http://www.facebook.com/") time = m.get("LastModifiedDate") if m.get( "LastModifiedDate") else m.get("CreatedDate") if time: try: m["display_time"] = utils.get_display_time( time, "%Y-%m-%dT%H:%M:%S.000Z") except: m["display_time"] = utils.get_display_time( time, "%Y-%m-%dT%H:%M:%S.000+0000") if m.get("FeedComments") and m["FeedComments"].get("totalSize") > 0: for c in m["FeedComments"].get("records"): self.convert_message(c) #if m.get("comments") and m["comments"].get("data"): # for c in m["comments"]["data"]: # c = self.convert_message(c) return m
def convert_message(self, m, isSearch=False): if m.get("retweeted_status") is not None: retweet_user = m.get("user") retweet_count = m.get("retweet_count") id = m.get("id_str") m = m["retweeted_status"] # m["favorited"] = False #なぞだが、RTされたツイートのfavoritedはどうもRTしたユーザのfavoritedが表示されているっぽい。 m["retweet_user"] = retweet_user m["retweet_count"] = retweet_count or 0 m["rt_id"] = m["id_str"] m["id_str"] = id # RTされたツイートのIDは古いため付け替えないと新着チェックロジックでおかしくなる m["id"] = m["id_str"] m["in_reply_to_status_id"] = m.get("in_reply_to_status_id_str") if isSearch: m["is_search"] = True m["user"] = {"screen_name": m["from_user"], "profile_image_url": m["profile_image_url"]} m["source"] = unescape(m["source"], {""": '"'}) m["display_time"] = utils.get_display_time(m["created_at"], "%a, %d %b %Y %H:%M:%S +0000") else: displayTime = utils.get_display_time(m["created_at"], "%a %b %d %H:%M:%S +0000 %Y") m["display_time"] = displayTime return m
def convert_message(self, m, isSearch=False): if m.get("retweeted_status") is not None: retweet_user = m.get("user") retweet_count = m.get("retweet_count") id = m.get("id_str") m = m["retweeted_status"] #m["favorited"] = False #なぞだが、RTされたツイートのfavoritedはどうもRTしたユーザのfavoritedが表示されているっぽい。 m["retweet_user"] = retweet_user m["retweet_count"] = retweet_count or 0 m["rt_id"] = m["id_str"] m["id_str"] = id #RTされたツイートのIDは古いため付け替えないと新着チェックロジックでおかしくなる m["id"] = m["id_str"] m["in_reply_to_status_id"] = m.get("in_reply_to_status_id_str") displayTime = utils.get_display_time(m["created_at"], "%a %b %d %H:%M:%S +0000 %Y"); m["display_time"] = displayTime return m
def convert_message(self, m, isSearch=False): if m.get("retweeted_status") is not None: retweet_user = m.get("user") retweet_count = m.get("retweet_count") id = m.get("id_str") m = m["retweeted_status"] #m["favorited"] = False #なぞだが、RTされたツイートのfavoritedはどうもRTしたユーザのfavoritedが表示されているっぽい。 m["retweet_user"] = retweet_user m["retweet_count"] = retweet_count or 0 m["rt_id"] = m["id_str"] m["id_str"] = id #RTされたツイートのIDは古いため付け替えないと新着チェックロジックでおかしくなる m["id"] = m["id_str"] m["in_reply_to_status_id"] = m.get("in_reply_to_status_id_str") displayTime = utils.get_display_time(m["created_at"], "%a %b %d %H:%M:%S +0000 %Y") m["display_time"] = displayTime return m