Last active
December 19, 2015 05:59
-
-
Save misablaha/5908262 to your computer and use it in GitHub Desktop.
Stats document format
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
/* | |
* Resources | |
* | |
* R: real data | |
* I: insights data | |
* L: linear interpolation | |
* | |
* U: used resource | |
*/ | |
{ | |
"id_": "164929129743-2003-06", // page_id + year + month | |
"id": "164929129743", | |
// day + hour | |
"0100": { | |
"R": {"fans": 115949, "pta": 1225}, // tohle je mozne serializovat | |
"I": {"fans": 116157, "pta": 1295}, | |
"U": {"fans": "R", "pta": "R"} | |
}, | |
"0101": { | |
"R": {"fans": 115949, "pta": 1225}, | |
"U": {"fans": "R", "pta": "R"} | |
}, | |
"0102": { | |
"L": {"fans": 116137}, | |
} | |
"0103": { | |
"R": {"fans": 1000, "pta": 1225}, | |
"L": {"fans": 117124}, | |
"U": {"fans": "L", "pta": "R"} | |
}, | |
} |
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
/* | |
* Output format | |
*/ | |
getData($pageId, $fromTms, $toTms, $field = null) | |
getData("164929129743", 1372759200, 1372770000) | |
{ | |
"1372759200": { | |
"R": {"fans": 115949, "pta": 1225}, | |
"I": {"fans": 116157, "pta": 1295}, | |
"U": {"fans": "R", "pta": "R"} | |
}, | |
"1372762800": { | |
"R": {"fans": 115949, "pta": 1225}, | |
"U": {"fans": "R", "pta": "R"} | |
}, | |
"1372766400": { | |
"L": {"fans": 116137}, | |
} | |
"1372770000": { | |
"R": {"fans": 1000, "pta": 1225}, | |
"L": {"fans": 117124}, | |
"U": {"fans": "L", "pta": "R"} | |
}, | |
} | |
getData("164929129743", 1372759200, 1372770000, 'fans') | |
{ | |
"1372759200": { | |
"R": 115949, | |
"I": 116157, | |
"U": "R" | |
}, | |
"1372762800": { | |
"R": 115949, | |
"U": "R" | |
}, | |
"1372766400": { | |
"L": 116137 | |
} | |
"1372770000": { | |
"R": 1000, | |
"L": 117124, | |
"U": "L" | |
}, | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment