Permalink
Browse files

First commit ...

  • Loading branch information...
PoUpA committed Sep 12, 2016
0 parents commit 3c02dc71205190255f1efffc1144a1a12908951e
Showing with 15,985 additions and 0 deletions.
  1. BIN 603px-Lausanne-coat_of_arms.svg.png
  2. BIN 6n3Mjyp.png
  3. +21 −0 LICENSE
  4. +75 −0 config.example.php
  5. +39 −0 core/cron/crontabs.include.php
  6. +102 −0 core/cron/gym.cron.php
  7. +51 −0 core/cron/pokemon.cron.php
  8. +90 −0 core/cron/pokemon.rarety.php
  9. +34 −0 core/cron/pokestop.cron.php
  10. +60 −0 core/cron/variables.json
  11. +6 −0 core/css/bootstrap.min.css
  12. +1 −0 core/css/bootstrap.min.css.map
  13. +2,199 −0 core/css/font-awesome.css
  14. +4 −0 core/css/font-awesome.min.css
  15. +319 −0 core/css/style.css
  16. BIN core/fonts/FontAwesome.otf
  17. BIN core/fonts/fontawesome-webfont.eot
  18. +685 −0 core/fonts/fontawesome-webfont.svg
  19. BIN core/fonts/fontawesome-webfont.ttf
  20. BIN core/fonts/fontawesome-webfont.woff
  21. BIN core/fonts/fontawesome-webfont.woff2
  22. BIN core/fonts/glyphicons-halflings-regular.eot
  23. +288 −0 core/fonts/glyphicons-halflings-regular.svg
  24. BIN core/fonts/glyphicons-halflings-regular.ttf
  25. BIN core/fonts/glyphicons-halflings-regular.woff
  26. BIN core/fonts/glyphicons-halflings-regular.woff2
  27. BIN core/img/blue-hover.png
  28. BIN core/img/compass.png
  29. BIN core/img/gotcha.png
  30. BIN core/img/gyms.png
  31. BIN core/img/instinct.png
  32. BIN core/img/logo.jpg
  33. BIN core/img/logo.png
  34. BIN core/img/lure-module.png
  35. BIN core/img/map-radar-pokemon-lausanne.jpg
  36. BIN core/img/map_blue.png
  37. BIN core/img/map_red.png
  38. BIN core/img/map_white.png
  39. BIN core/img/map_yellow.png
  40. BIN core/img/mystic.png
  41. BIN core/img/pawprints.png
  42. BIN core/img/pokeball.png
  43. BIN core/img/pokemon-lausanne-pikatchu.jpg
  44. BIN core/img/pokestap.png
  45. BIN core/img/pokestap_lured.png
  46. BIN core/img/pokestop.png
  47. BIN core/img/radar-pokemon-lausanne.png
  48. BIN core/img/rocket.png
  49. BIN core/img/smartphone.png
  50. +1 −0 core/img/sprout.svg
  51. BIN core/img/valor.png
  52. +1 −0 core/inc/index.html
  53. +195 −0 core/inc/meta.inc.php
  54. +1 −0 core/index.html
  55. +7 −0 core/js/bootstrap.min.js
  56. +555 −0 core/js/dashboard.graph.js.php
  57. +99 −0 core/js/gym.graph.js.php
  58. +88 −0 core/js/gym.maps.js
  59. +49 −0 core/js/gym.script.js
  60. +337 −0 core/js/holmes.js
  61. +79 −0 core/js/home.script.js
  62. +1 −0 core/js/index.html
  63. +1 −0 core/js/microlight.js
  64. +173 −0 core/js/pokemon.graph.js.php
  65. +109 −0 core/js/pokemon.maps.js.php
  66. +79 −0 core/js/pokestops.maps.js
  67. +1 −0 core/json/index.html
  68. +3,357 −0 core/json/pokelist_EN.json
  69. +3,357 −0 core/json/pokelist_FR.json
  70. +403 −0 core/json/translations.json
  71. +68 −0 core/json/variables.examples.json
  72. BIN core/meta-icons/android-icon-144x144.png
  73. BIN core/meta-icons/android-icon-192x192.png
  74. BIN core/meta-icons/android-icon-36x36.png
  75. BIN core/meta-icons/android-icon-48x48.png
  76. BIN core/meta-icons/android-icon-72x72.png
  77. BIN core/meta-icons/android-icon-96x96.png
  78. BIN core/meta-icons/apple-icon-114x114.png
  79. BIN core/meta-icons/apple-icon-120x120.png
  80. BIN core/meta-icons/apple-icon-144x144.png
  81. BIN core/meta-icons/apple-icon-152x152.png
  82. BIN core/meta-icons/apple-icon-180x180.png
  83. BIN core/meta-icons/apple-icon-57x57.png
  84. BIN core/meta-icons/apple-icon-60x60.png
  85. BIN core/meta-icons/apple-icon-72x72.png
  86. BIN core/meta-icons/apple-icon-76x76.png
  87. BIN core/meta-icons/apple-icon-precomposed.png
  88. BIN core/meta-icons/apple-icon.png
  89. +2 −0 core/meta-icons/browserconfig.xml
  90. BIN core/meta-icons/favicon-16x16.png
  91. BIN core/meta-icons/favicon-32x32.png
  92. BIN core/meta-icons/favicon-96x96.png
  93. BIN core/meta-icons/favicon.ico
  94. +41 −0 core/meta-icons/manifest.json
  95. BIN core/meta-icons/ms-icon-144x144.png
  96. BIN core/meta-icons/ms-icon-150x150.png
  97. BIN core/meta-icons/ms-icon-310x310.png
  98. BIN core/meta-icons/ms-icon-70x70.png
  99. BIN core/pokemons/1.png
  100. BIN core/pokemons/10.png
  101. BIN core/pokemons/100.png
  102. BIN core/pokemons/101.png
  103. BIN core/pokemons/102.png
  104. BIN core/pokemons/103.png
  105. BIN core/pokemons/104.png
  106. BIN core/pokemons/105.png
  107. BIN core/pokemons/106.png
  108. BIN core/pokemons/107.png
  109. BIN core/pokemons/108.png
  110. BIN core/pokemons/109.png
  111. BIN core/pokemons/11.png
  112. BIN core/pokemons/110.png
  113. BIN core/pokemons/111.png
  114. BIN core/pokemons/112.png
  115. BIN core/pokemons/113.png
  116. BIN core/pokemons/114.png
  117. BIN core/pokemons/115.png
  118. BIN core/pokemons/116.png
  119. BIN core/pokemons/117.png
  120. BIN core/pokemons/118.png
  121. BIN core/pokemons/119.png
  122. BIN core/pokemons/12.png
  123. BIN core/pokemons/120.png
  124. BIN core/pokemons/121.png
  125. BIN core/pokemons/122.png
  126. BIN core/pokemons/123.png
  127. BIN core/pokemons/124.png
  128. BIN core/pokemons/125.png
  129. BIN core/pokemons/126.png
  130. BIN core/pokemons/127.png
  131. BIN core/pokemons/128.png
  132. BIN core/pokemons/129.png
  133. BIN core/pokemons/13.png
  134. BIN core/pokemons/130.png
  135. BIN core/pokemons/131.png
  136. BIN core/pokemons/132.png
  137. BIN core/pokemons/133.png
  138. BIN core/pokemons/134.png
  139. BIN core/pokemons/135.png
  140. BIN core/pokemons/136.png
  141. BIN core/pokemons/137.png
  142. BIN core/pokemons/138.png
  143. BIN core/pokemons/139.png
  144. BIN core/pokemons/14.png
  145. BIN core/pokemons/140.png
  146. BIN core/pokemons/141.png
  147. BIN core/pokemons/142.png
  148. BIN core/pokemons/143.png
  149. BIN core/pokemons/144.png
  150. BIN core/pokemons/145.png
  151. BIN core/pokemons/146.png
  152. BIN core/pokemons/147.png
  153. BIN core/pokemons/148.png
  154. BIN core/pokemons/149.png
  155. BIN core/pokemons/15.png
  156. BIN core/pokemons/150.png
  157. BIN core/pokemons/151.png
  158. BIN core/pokemons/16.png
  159. BIN core/pokemons/17.png
  160. BIN core/pokemons/18.png
  161. BIN core/pokemons/19.png
  162. BIN core/pokemons/2.png
  163. BIN core/pokemons/20.png
  164. BIN core/pokemons/21.png
  165. BIN core/pokemons/22.png
  166. BIN core/pokemons/23.png
  167. BIN core/pokemons/24.png
  168. BIN core/pokemons/25.png
  169. BIN core/pokemons/26.png
  170. BIN core/pokemons/27.png
  171. BIN core/pokemons/28.png
  172. BIN core/pokemons/29.png
  173. BIN core/pokemons/3.png
  174. BIN core/pokemons/30.png
  175. BIN core/pokemons/31.png
  176. BIN core/pokemons/32.png
  177. BIN core/pokemons/33.png
  178. BIN core/pokemons/34.png
  179. BIN core/pokemons/35.png
  180. BIN core/pokemons/36.png
  181. BIN core/pokemons/37.png
  182. BIN core/pokemons/38.png
  183. BIN core/pokemons/39.png
  184. BIN core/pokemons/4.png
  185. BIN core/pokemons/40.png
  186. BIN core/pokemons/41.png
  187. BIN core/pokemons/42.png
  188. BIN core/pokemons/43.png
  189. BIN core/pokemons/44.png
  190. BIN core/pokemons/45.png
  191. BIN core/pokemons/46.png
  192. BIN core/pokemons/47.png
  193. BIN core/pokemons/48.png
  194. BIN core/pokemons/49.png
  195. BIN core/pokemons/5.png
  196. BIN core/pokemons/50.png
  197. BIN core/pokemons/51.png
  198. BIN core/pokemons/52.png
  199. BIN core/pokemons/53.png
  200. BIN core/pokemons/54.png
  201. BIN core/pokemons/55.png
  202. BIN core/pokemons/56.png
  203. BIN core/pokemons/57.png
  204. BIN core/pokemons/58.png
  205. BIN core/pokemons/59.png
  206. BIN core/pokemons/6.png
  207. BIN core/pokemons/60.png
  208. BIN core/pokemons/61.png
  209. BIN core/pokemons/62.png
  210. BIN core/pokemons/63.png
  211. BIN core/pokemons/64.png
  212. BIN core/pokemons/65.png
  213. BIN core/pokemons/66.png
  214. BIN core/pokemons/67.png
  215. BIN core/pokemons/68.png
  216. BIN core/pokemons/69.png
  217. BIN core/pokemons/7.png
  218. BIN core/pokemons/70.png
  219. BIN core/pokemons/71.png
  220. BIN core/pokemons/72.png
  221. BIN core/pokemons/73.png
  222. BIN core/pokemons/74.png
  223. BIN core/pokemons/75.png
  224. BIN core/pokemons/76.png
  225. BIN core/pokemons/77.png
  226. BIN core/pokemons/78.png
  227. BIN core/pokemons/79.png
  228. BIN core/pokemons/8.png
  229. BIN core/pokemons/80.png
  230. BIN core/pokemons/81.png
  231. BIN core/pokemons/82.png
  232. BIN core/pokemons/83.png
  233. BIN core/pokemons/84.png
  234. BIN core/pokemons/85.png
  235. BIN core/pokemons/86.png
  236. BIN core/pokemons/87.png
  237. BIN core/pokemons/88.png
  238. BIN core/pokemons/89.png
  239. BIN core/pokemons/9.png
  240. BIN core/pokemons/90.png
  241. BIN core/pokemons/91.png
  242. BIN core/pokemons/92.png
  243. BIN core/pokemons/93.png
  244. BIN core/pokemons/94.png
  245. BIN core/pokemons/95.png
  246. BIN core/pokemons/96.png
  247. BIN core/pokemons/97.png
  248. BIN core/pokemons/98.png
  249. BIN core/pokemons/99.png
  250. +409 −0 core/process/aru.php
  251. +682 −0 core/process/data.loader.php
  252. +1 −0 core/process/index.html
  253. +198 −0 functions.php
  254. +1 −0 google2393b88005e9fe18.html
  255. +38 −0 htaccess
  256. +323 −0 index.php
  257. +130 −0 install.sh
  258. +1 −0 install/index.html
  259. +157 −0 install/tester.php
  260. +46 −0 offline.html
  261. +15 −0 pages/404.page.php
  262. +117 −0 pages/dashboard.page.php
  263. +91 −0 pages/gym.page.php
  264. +93 −0 pages/home.page.php
  265. +95 −0 pages/home.page.php.bkp
  266. +1 −0 pages/index.html
  267. +105 −0 pages/link.page.php
  268. +40 −0 pages/pokedex.page.php
  269. +264 −0 pages/pokemon.page.php
  270. +38 −0 pages/pokestops.page.php
  271. +38 −0 pages/spawnpoints.page.php
  272. +95 −0 pages/trainers.page.php
  273. BIN pogolsne.png
  274. +27 −0 readme.md
  275. +2 −0 robots.txt
Binary file not shown.
BIN +16.9 KB 6n3Mjyp.png
Binary file not shown.
21 LICENSE
@@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2016 Amaury Lesplingart - Simon Vandereecken
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
@@ -0,0 +1,75 @@
<?php
/**
* @file
* A single location to store configuration.
*/
# EDIT ME PLEASE
// mysql db name
define('SYS_DB_NAME' ,'#SYS_DB_NAME#');
// mysql username
define('SYS_DB_USER' ,'#SYS_DB_USER#');
// mysql password
define('SYS_DB_PSWD' ,'#SYS_DB_PSWD#');
// mysql server name
define('SYS_DB_HOST' ,'#SYS_DB_HOST#');
// mysql server port
define('SYS_DB_PORT' ,3306);
# Please, do not touch me, I'm fine ;)
// full path
define('SYS_PATH' ,realpath(dirname(__FILE__)));
// user session variable name
define('SYS_USESS_VAR' ,'usrSessVal');
// debug mode
define('SYS_DEVELOPMENT_MODE' ,false);
if(directory() != ''){
$subdirectory = '/'.directory().'/';
}else{
$subdirectory = '/';
}
if(isset($_SERVER['REQUEST_SCHEME'])){
define('HOST_URL' , $_SERVER['REQUEST_SCHEME'].'://'.$_SERVER['HTTP_HOST'].''.$subdirectory); // Host
}else{
if(isset($_SERVER['HTTPS']) AND $_SERVER['HTTPS'] == 'on'){
define('HOST_URL' , 'https://'.$_SERVER['HTTP_HOST']); // Host
}else{
define('HOST_URL' , 'http://'.$_SERVER['HTTP_HOST']); // Host
}
}
## Subdirectory trick
function directory(){
$root = $_SERVER['DOCUMENT_ROOT'];
$filePath = dirname(__FILE__);
if ($root == $filePath) {
return ''; // installed in the root
} else {
$subdir_path = explode('/', $filePath);
$subdir = end($subdir_path);
return $subdir;
}
}
?>
@@ -0,0 +1,39 @@
<?php
// This file only include other files to have only 1 entry in your crontabs.
// ------------------------------------------------------------------------
$filePath = dirname(__FILE__);
$config_file = $filePath.'/../../config.php';
include_once($config_file);
# MySQL
$mysqli = new mysqli(SYS_DB_HOST, SYS_DB_USER, SYS_DB_PSWD, SYS_DB_NAME, SYS_DB_PORT);
if($mysqli->connect_error != ''){
die('MySQL connect error');
}
$gym_file = SYS_PATH.'/core/json/gym.stats.json';
$pokestop_file = SYS_PATH.'/core/json/pokestop.stats.json';
$pokemon_file = SYS_PATH.'/core/json/pokemon.stats.json';
$gymsdatas = json_decode(file_get_contents($gym_file), true);
$stopdatas = json_decode(file_get_contents($pokestop_file), true);
$pokedatas = json_decode(file_get_contents($pokemon_file), true);
$timestamp = time();
include_once(SYS_PATH.'/core/cron/gym.cron.php');
include_once(SYS_PATH.'/core/cron/pokemon.cron.php');
include_once(SYS_PATH.'/core/cron/pokestop.cron.php');
?>
@@ -0,0 +1,102 @@
<?php
// -----------------------------------------------------------------------------------------------------------
// Gym datas
// Total gym
// Gym / team
// Average level / team
// -----------------------------------------------------------------------------------------------------------
$gym['timestamp'] = $timestamp;
$req = "SELECT count( DISTINCT(gym_id) ) as total FROM gym";
$result = $mysqli->query($req);
$data = $result->fetch_object();
$gym['total'] = $data->total;
// Mystic
$req = "SELECT count( DISTINCT(gym_id) ) as total FROM gym WHERE team_id = '1' ";
$result = $mysqli->query($req);
$data = $result->fetch_object();
$gym['team']['mystic']['gym_owned'] = $data->total;
$req = "SELECT gym_points FROM gym WHERE team_id = '1' ";
$result = $mysqli->query($req);
$total_points=0;
while($data = $result->fetch_object()){
$total_points = $total_points + $data->gym_points;
}
$gym['team']['mystic']['average'] = round($total_points / $gym['team']['mystic']['gym_owned']);
// Valor
$req = "SELECT count( DISTINCT(gym_id) ) as total FROM gym WHERE team_id = '2' ";
$result = $mysqli->query($req);
$data = $result->fetch_object();
$gym['team']['valor']['gym_owned'] = $data->total;
$req = "SELECT gym_points FROM gym WHERE team_id = '2' ";
$result = $mysqli->query($req);
$total_points=0;
while($data = $result->fetch_object()){
$total_points = $total_points + $data->gym_points;
}
$gym['team']['valor']['average'] = round($total_points / $gym['team']['valor']['gym_owned']);
// Instinct
$req = "SELECT count( DISTINCT(gym_id) ) as total FROM gym WHERE team_id = '3' ";
$result = $mysqli->query($req);
$data = $result->fetch_object();
$gym['team']['instinct']['gym_owned'] = $data->total;
$req = "SELECT gym_points FROM gym WHERE team_id = '3' ";
$result = $mysqli->query($req);
$total_points=0;
while($data = $result->fetch_object()){
$total_points = $total_points + $data->gym_points;
}
$gym['team']['instinct']['average'] = round($total_points / $gym['team']['instinct']['gym_owned']);
// Add the datas in file
$gymsdatas[] = $gym;
$json = json_encode($gymsdatas);
file_put_contents($gym_file, $json);
?>
@@ -0,0 +1,51 @@
<?php
// -----------------------------------------------------------------------------------------------------------
// Pokemons datas
// Total pokemon available
// -----------------------------------------------------------------------------------------------------------
// We're using the EN version as far as we know, it's the only valable version of Pokelist for now.
// This file is used to rank by rarety
$pokemon_list_file = file_get_contents(SYS_PATH.'/core/json/pokelist_EN.json');
$pokemons = json_decode($pokemon_list_file);
$pokemon_stats['timestamp'] = $timestamp;
$req = "SELECT COUNT(*) as total FROM pokemon WHERE disappear_time > (NOW() - INTERVAL 2 HOUR);";
$result = $mysqli->query($req);
$data = $result->fetch_object();
$pokemon_stats['pokemon_now'] = $data->total;
$req = "SELECT pokemon_id FROM pokemon WHERE disappear_time > (NOW() - INTERVAL 2 HOUR);";
$result = $mysqli->query($req);
while($data = $result->fetch_object()){
$poke_id = $data->pokemon_id;
$rarity = $pokemons->$poke_id->rarity;
@$type[$rarity] = $type[$rarity]+1;
}
$pokemon_stats['rarity_spawn'] = $type;
// Add the datas in file
$pokedatas[] = $pokemon_stats;
$json = json_encode($pokedatas);
file_put_contents($pokemon_file, $json);
?>
@@ -0,0 +1,90 @@
<?php
// This file is loaded once every 24h by data the loader.
// ------------------------------------------------------
$pokemons = json_decode($pokemon_file);
$req = "SELECT pokemon_id, COUNT(1) as total FROM pokemon GROUP BY pokemon_id ORDER BY pokemon_id ASC";
$result = $mysqli->query($req);
$total_pokemons = 0;
while($data = $result->fetch_object()){
$pokemon_id = $data->pokemon_id;
$total_pokemons = $total_pokemons + $data->total;
$pokelist[$pokemon_id]['id'] = $pokemon_id;
$pokelist[$pokemon_id]['total'] = $data->total;
}
foreach($pokelist as $pokemon){
$key = $pokemon['id'];
$pourcent = ($pokemon['total']*100) / $total_pokemons;
$arrondis = round($pourcent , 4);
$pokelist[$key]['rate'] = $arrondis;
// + 1 = Very common
// + 0.25 = Common
// + 0.05 = Rare
// + 0.0001 = Mythic
// Unseen
if($arrondis >= 1){
$pokelist[$key]['status'] = 'Very common';
}elseif($arrondis >= 0.25){
$pokelist[$key]['status'] = 'Common';
}elseif($arrondis >= 0.05){
$pokelist[$key]['status'] = 'Rare';
}elseif($arrondis >= 0.0001){
$pokelist[$key]['status'] = 'Mythic';
}else{
$pokelist[$key]['status'] = 'Unseen';
}
}
foreach($pokemons as $pokemon_id => $pokemon_data){
if(isset($pokelist[$pokemon_id])){
$pokemon_data->rarity = $pokelist[$pokemon_id]['status'];
$pokemon_data->spawn_rate = $pokelist[$pokemon_id]['rate'];
}
else{
$pokemon_data->rarity = 'Unseen';
$pokemon_data->spawn_rate = 0.0000;
}
}
$file_content = json_encode($pokemons);
file_put_contents($pokedex, $file_content);
?>
Oops, something went wrong.

0 comments on commit 3c02dc7

Please sign in to comment.