-
Notifications
You must be signed in to change notification settings - Fork 0
/
interlink_tag_conferences.php
39 lines (33 loc) · 1.36 KB
/
interlink_tag_conferences.php
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
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
require_once('SMNIncludes.php');
require_once('includes.php');
error_reporting(E_ERROR | E_PARSE);
$existing_users = SMNUserQueries::allUsers();
$all_existing_tags = SMNTagQueries::allHashTags();
$existing_tags = array_chunk($all_existing_tags, 400, true);
$tagsnumber = count($all_existing_tags);
echo "Interlinking ".$tagsnumber." tags <br/>".PHP_EOL;
$elapsed_tags = 0;
$average_time = 0;
$remaining_est_time = 0;
$elapsed_time = 0;
foreach($existing_tags as $tags) {
//echo "current tags: ".print_r($tags).PHP_EOL.PHP_EOL;
list($usec, $sec) = explode(' ', microtime());
$script_start = (float) $sec + (float) $usec;
echo "found conferences: ".PHP_EOL;
print_r(SMNOpenDataLinker::colindaMeanings($tags));
echo PHP_EOL;
list($usec, $sec) = explode(' ', microtime());
$script_end = (float) $sec + (float) $usec;
$elapsed_time += round($script_end - $script_start, 5);
$elapsed_tags+=count($tags);
$average_time = $elapsed_time / $elapsed_tags;
$remaining_est_time = ($tagsnumber - $elapsed_tags) * $average_time;
echo "Done: " . $elapsed_tags . "tags - Time: " . convertTime($elapsed_time) . " Est Remaining: " . convertTime($remaining_est_time) . '<br />' . PHP_EOL;
}
?>