-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathindex.php
More file actions
39 lines (28 loc) · 893 Bytes
/
Copy pathindex.php
File metadata and controls
39 lines (28 loc) · 893 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
36
37
38
39
<?php
date_default_timezone_set('Europe/London');
define('GAMERTAGS_CSV', 'gamertags.csv');
header('Content-Type: text/plain');
// get the composer autoloader
include __DIR__ . '/vendor/autoload.php';
if (!file_exists(GAMERTAGS_CSV)) {
touch(GAMERTAGS_CSV);
include __DIR__ . '/generate_gamertags.php';
generate_gamertags();
}
// get our config file
include __DIR__ . '/config.php';
// load the helper files
include __DIR__ . '/helpers/database.php';
include __DIR__ . '/helpers/xboxapi.php';
$count = Gamertag::whereNull('xuid')->count();
while ($count > 0) {
$gamertags = Gamertag::whereNull('xuid')->take(500)->get();
foreach ($gamertags as $gamertag) {
$gamertag = getXuid($gamertag);
if ($gamertag !== false) {
print $gamertag . PHP_EOL;
$count--;
}
}
$count = Gamertag::whereNull('xuid')->count();
}