Beispiel #1
0
 def __format_facebook_message(self, message):
     datetime  = outputs.time_convert(message[1][:-3])
     author_id = message[0]
     dest_id   = message[3]
     return datetime +\
         " by "+ author_id + \
         " to "+ dest_id +\
         " : " + outputs.urldecode(message[2])
Beispiel #2
0
 def html_code(self, input_list):
     t = outputs.HTML.Table(header_row=["Timestamp", "Avatar", "Author", "Message"], classes="table table-striped")
     for message in input_list:
         messenger_id = (
             '<a href="https://twitter.com/' + message[2] + '">' + message[2] + "</a> (" + message[3] + ")"
         )
         avatar = '<img src="' + message[4] + '" height="40" width="40" />'
         datetime = outputs.time_convert(message[6])
         t.rows.append([datetime, avatar, messenger_id, message[5]])
     html_code = str(t)
     return html_code
Beispiel #3
0
    def html_code(self, input_list):
        t = outputs.HTML.Table(
                header_row=[
                    'Timestamp',
                    'Author',
                    'Receiver (group)',
                    'Message',
                    'Participants',
                    'Former Participants',
                    'Count'
                ],
                classes="table table-striped"
            )
        for message in input_list:
            datetime  = outputs.time_convert(message[6][:-3])
            author_id = '<a href="https://facebook.com/'+\
                message[4]+'">' + message[4] +'</a>'
            dest_id   = '<a href="https://facebook.com/'+\
                message[0]+'">' + message[0] +'</a>'
            count     = message[5]

            part = []
            for p in message[1].split(","):
                tp = '<a href="https://facebook.com/'+p[6:-1]+'">'+p[6:-1]+'</a>'
                part.append(tp)

            fpart = []
            for fp in message[2].split(","):
                tfp = '<a href="https://facebook.com/'+fp[6:-1]+'">'+fp[6:-1]+'</a>'
                fpart.append(tfp)

            participants = outputs.HTML.List(
                lines = part,
                attribs = { "class" : "list-unstyled" }
                )
            former_participants = outputs.HTML.List(
                lines = fpart,
                attribs = { "class" : "list-unstyled" }
                )

            t.rows.append([
                datetime,
                author_id,
                dest_id,
                message[3],
                participants,
                former_participants,
                count])
        return str(t)
Beispiel #4
0
    def __format_facebook_threads_message(self, message):
        datetime = outputs.time_convert(message[6][:-3])
        author_id = message[4]
        dest_id = message[0]

        participants = []
        for p in message[1].split(","):
            participants.append(p[6:-1])

        former_participants = []
        for fp in message[2].split(","):
            former_participants.append(fp[6:-1])

        return datetime + " by " + author_id + " to " + dest_id + " : " +\
            message[3] +", with these participants: " + str(participants) +\
            " and these former participants: " + str(former_participants)
Beispiel #5
0
 def html_code(self, input_list):
     t = outputs.HTML.Table(
             header_row=[
                 'Timestamp',
                 'Author',
                 'Receiver',
                 'Message',
             ],
             classes="table table-striped"
         )
     for message in input_list:
         datetime  = outputs.time_convert(message[1][:-3])
         author_id = '<a href="https://facebook.com/'+\
             message[0]+'">' + message[0] +'</a>'
         dest_id   = '<a href="https://facebook.com/'+\
             message[3]+'">' + message[3] +'</a>'
         t.rows.append(
             [datetime, author_id, dest_id, outputs.urldecode(message[2])])
     return str(t)
Beispiel #6
0
 def __format_twitter_message(self, message):
     messenger_id = message[2] + "(" + message[3] + ")"
     datetime = outputs.time_convert(message[6])
     formated_message = datetime + " by " + messenger_id + ":" + message[5]
     return formated_message