Skip to content

Instantly share code, notes, and snippets.

@rossja
Last active July 11, 2020 17:00
Show Gist options
  • Save rossja/fddcb6ddaaa0ab1b1292580009434555 to your computer and use it in GitHub Desktop.
Save rossja/fddcb6ddaaa0ab1b1292580009434555 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python3
# =================================================
# stupid script to dump kik profile data without a login or bot API key
# example command: `kiksnarf.py Kikteam`
# example output:
# fetching profile from: https://ws2.kik.com/user/Kikteam
# Name: Kik Team
# Display Pic URL: http://profilepics.cf.kik.com/9wG3zRZW8sLxLnpmyOfwNE7ChYk/orig.jpg
# Display Pic Last Updated: 2018-07-12T18:00:02Z
# =================================================
import sys
import requests
import json
import datetime
baseurl = 'https://ws2.kik.com/user/'
userId = sys.argv[1]
url = baseurl + userId
print("fetching profile from: %s" % url)
r = requests.get(url)
jsonData = r.json()
# ----- tweak the format of the last updated timestamp --- #
# divide by 1000 because javascript timestamp includes milliseconds
ts = jsonData["displayPicLastModified"] / 1000
# format the last update timestamp to human readable (ISO 8601) format
lastModified_ISO = datetime.datetime.fromtimestamp(ts, tz=datetime.timezone.utc).strftime('%Y-%m-%dT%H:%M%:%SZ')
# ---- done tweaking the timestamp ---- #
print("Name: %s %s" % (jsonData["firstName"], jsonData["lastName"]) )
print("Display Pic URL: %s" % jsonData["displayPic"])
print("Display Pic Last Updated: %s" % lastModified_ISO)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment