import json
import fileinput

first = True
for line in fileinput.input():
    # skip the header
    if first:
        first = False
        continue

    cols = line.strip().split('\t')

    # output some hallucinated clickstream event in the format we will
    # eventually expect

    output = {"key": "pageview",
              "username": cols[2],
              "timestamp": int(cols[0])}

    if cols[1] == "1":
        output["value"] = "https://www.coursera.org/forum/posted_thread"
    else:
        output["value"] = "https://www.coursera.org/forum/posted_reply"

    print(json.dumps(output))

9b9be18ad182e91da022442b3c42440e07d4fb72
<mask token>

<mask token>
for line in fileinput.input():
    if first:
        first = False
        continue
    cols = line.strip().split('\t')
    output = {'key': 'pageview', 'username': cols[2], 'timestamp': int(cols[0])
        }
    if cols[1] == '1':
        output['value'] = 'https://www.coursera.org/forum/posted_thread'
    else:
        output['value'] = 'https://www.coursera.org/forum/posted_reply'
    print(json.dumps(output))

<mask token>
first = True
for line in fileinput.input():
    if first:
        first = False
        continue
    cols = line.strip().split('\t')
    output = {'key': 'pageview', 'username': cols[2], 'timestamp': int(cols[0])
        }
    if cols[1] == '1':
        output['value'] = 'https://www.coursera.org/forum/posted_thread'
    else:
        output['value'] = 'https://www.coursera.org/forum/posted_reply'
    print(json.dumps(output))

import json
import fileinput
first = True
for line in fileinput.input():
    if first:
        first = False
        continue
    cols = line.strip().split('\t')
    output = {'key': 'pageview', 'username': cols[2], 'timestamp': int(cols[0])
        }
    if cols[1] == '1':
        output['value'] = 'https://www.coursera.org/forum/posted_thread'
    else:
        output['value'] = 'https://www.coursera.org/forum/posted_reply'
    print(json.dumps(output))

import json
import fileinput

first = True
for line in fileinput.input():
    # skip the header
    if first:
        first = False
        continue

    cols = line.strip().split('\t')

    # output some hallucinated clickstream event in the format we will
    # eventually expect

    output = {"key": "pageview",
              "username": cols[2],
              "timestamp": int(cols[0])}

    if cols[1] == "1":
        output["value"] = "https://www.coursera.org/forum/posted_thread"
    else:
        output["value"] = "https://www.coursera.org/forum/posted_reply"

    print(json.dumps(output))
