Last active
August 19, 2017 16:54
-
-
Save lockefox/6736b822459cafadbb6841e844c34282 to your computer and use it in GitHub Desktop.
zkb vs pandas demo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import pymongo | |
req = requests.get('https://zkillboard.com/api/losses/solo/') | |
req.raise_for_status() | |
recent_solo_losses_raw = req.json() #200 latest events | |
conn = pymongo.MongoClient(MONGO_CONNECTION_STRING) | |
conn.db.zkb.insert(recent_solo_losses_raw) | |
print(recent_solo_losses_raw[0]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"killID": 64158479, | |
"solarSystemID": 30000157, | |
"killTime": "2017-08-19 16:28:48", | |
"moonID": 0, | |
"victim": { | |
"shipTypeID": 583, | |
"characterID": 94315372, | |
"characterName": "Canatana Jovakko", | |
"corporationID": 1699307293, | |
"corporationName": "Red Federation", | |
"allianceID": 99000645, | |
"allianceName": "RvB - RED Federation", | |
"factionID": 0, | |
"factionName": "", | |
"damageTaken": 1221 | |
}, | |
"attackers": [ | |
{ | |
"characterID": 96374911, | |
"characterName": "Taylor Moon Mahyisti", | |
"corporationID": 1699307293, | |
"corporationName": "Red Federation", | |
"allianceID": 99000645, | |
"allianceName": "RvB - RED Federation", | |
"factionID": 0, | |
"factionName": "", | |
"securityStatus": 1, | |
"damageDone": 1221, | |
"finalBlow": 1, | |
"weaponTypeID": 6675, | |
"shipTypeID": 591 | |
} | |
], | |
"items": [ | |
{ | |
"typeID": 5445, | |
"flag": 20, | |
"qtyDropped": 1, | |
"qtyDestroyed": 0, | |
"singleton": 0 | |
}, | |
... | |
], | |
"position": { | |
"y": -327762003.54411, | |
"x": 27668971838.564, | |
"z": 66846273372.285 | |
}, | |
"zkb": { | |
"locationID": 40009948, | |
"hash": "ef96d0c4a53b0a016e5eed28e91d52710de8ab61", | |
"fittedValue": 8162585.38, | |
"totalValue": 8325314.02, | |
"points": 23, | |
"npc": false | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment