Skip to content

Instantly share code, notes, and snippets.

@JensenDied
Last active November 1, 2016 05:27
Show Gist options
  • Save JensenDied/82675ab5a7ce471742be to your computer and use it in GitHub Desktop.
Save JensenDied/82675ab5a7ce471742be to your computer and use it in GitHub Desktop.
Proof of concept script to fetch portal captured time
#!/bin/sh
# Navigate to https://m-dot-betaspike.appspot.com/handshake, login with your ingress account, use the SACSID cookie to populate the following
AUTH="SACSID="
# Grab a portal guid from intel, open network tab and clear stuff, click on a portal, look for getPortalDetails and fetch the guid from the request param
portalGuid=""
INGRESS_VERSION="%7B%22nemesisSoftwareVersion%22%3A%222014-09-30T18%3A10%3A49z%208c0548b9de8d%20opt%22%2C%22deviceSoftwareVersion%22%3A%220.0.0%22%7D"
INGRESS_URL="https://m-dot-betaspike.appspot.com"
# Login and get an xsrfToken
xsrfToken="X-XsrfToken: "`curl -s -S -b $AUTH -d $INGRESS_VERSION $INGRESS_URL/handshake |sed 's/.*xsrfToken":"\([^"]*\)".*/\1/'|tail -n 1`
portalData='{"params":{"clientBasket":{"clientBlob":null},"energyGlobGuids":[],"guids":["'$portalGuid'"],"knobSyncTimestamp":0,"location":"00000000,00000000","timestampsMs":[0]}}'
alias ingressCurl="curl -s -S -A \"Nemesis (gzip)\" -H \"Content-Type: application/json\" -H \"Accept: application/json\" -H \"$xsrfToken\" -X POST -b \"$AUTH\""
capturedTime=`ingressCurl -d "$portalData" -L "$INGRESS_URL/rpc/gameplay/getModifiedEntitiesByGuid"|sed 's/.*"capturedTime":"\([^"]*\)".*/\1/' | sed 's/\(.*\).../\1/' `
date --date="@$capturedTime"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment