forked from chriszhou1992/ABCD
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpopulateDatabase.php
More file actions
35 lines (30 loc) · 870 Bytes
/
populateDatabase.php
File metadata and controls
35 lines (30 loc) · 870 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php
require_once "classes/Game.php";
ini_set('max_execution_time', 300000);
require_once "classes/connecToDB.php";
$con = connectToDB();
if($con === false):
return;
endif;
//done: from 27000 to 40000 with date-released >= 2008
$id = 27000;
while($id !== 60000) {
$url = "http://www.giantbomb.com/api/game/".$id."/?api_key=cff26a832d7766443856b114c9764df2b8def7d0&format=json";
$g = new Game(true, $url, $con);
//$g->printGameInfo();
$g->insert();
$id++;
}
/*
require_once "classes/Company.php";
ini_set('max_execution_time', 300000);
$id = 0;
//done: from 0 to 6000 with most fields non-empty
while($id !== 6000) {
$url = "http://www.giantbomb.com/api/company/3010-".$id."/?api_key=cff26a832d7766443856b114c9764df2b8def7d0&format=json";
$c = new Company(true, $url);
//$c->printCompanyInfo();
$c->insert();
$id++;
}
*/