Renaming of Talk With a Techie acronym to TWT (part 1/n)

This commit is contained in:
2024-05-31 00:01:09 -07:00
parent 713097d164
commit 3c638cc32f
7 changed files with 90 additions and 90 deletions

View File

@@ -18,11 +18,11 @@ if (isset($_GET['format'])){
}
}
$twat_startdate = abs(strtotime(date("c")) - strtotime("2005-09-19T00:00:00Z"));
$twat_years = floor($twat_startdate / (365*60*60*24));
$twat_months = floor(($twat_startdate - $twat_years * 365*60*60*24) / (30*60*60*24));
$twat_days = floor(($twat_startdate - $twat_years * 365*60*60*24 - $twat_months*30*60*60*24)/ (60*60*24));
$agetwat = $twat_startdate;
$twt_startdate = abs(strtotime(date("c")) - strtotime("2005-09-19T00:00:00Z"));
$twt_years = floor($twt_startdate / (365*60*60*24));
$twt_months = floor(($twt_startdate - $twt_years * 365*60*60*24) / (30*60*60*24));
$twt_days = floor(($twt_startdate - $twt_years * 365*60*60*24 - $twt_months*30*60*60*24)/ (60*60*24));
$age_twt = $twt_startdate;
$hpr_startdate = abs(strtotime(date("c")) - strtotime("2007-12-31T00:00:00Z"));
$hpr_years = floor($hpr_startdate / (365*60*60*24));
@@ -212,10 +212,10 @@ if ($format === "json") {
\"start\": \"2005-09-19T00:00:00Z\",
\"rename\": \"2007-12-31T00:00:00Z\",
\"since_start\": {
\"total_seconds\": ".$agetwat.",
\"years\": ".$twat_years.",
\"months\": ".$twat_months.",
\"days\": ".$twat_days."
\"total_seconds\": ".$age_twt.",
\"years\": ".$twt_years.",
\"months\": ".$twt_months.",
\"days\": ".$twt_days."
},
\"since_rename\": {
\"total_seconds\": ".$agehpr.",
@@ -226,7 +226,7 @@ if ($format === "json") {
},
\"shows\": {
\"total\": ".$totalshows.",
\"twat\": 300,
\"twt\": 300,
\"hpr\": ".$totalhpr.",
\"duration\": ".$total_duration.",
\"human_duration\": \"".$human_total_duration."\"
@@ -258,10 +258,10 @@ elseif ($format === "xml") {
<start>2005-09-19T00:00:00Z</start>
<rename>2007-12-31T00:00:00Z</rename>
<since_start>
<total_seconds>".$agetwat."</total_seconds>
<years>". $twat_years."</years>
<months>".$twat_months."</months>
<days>".$twat_days."</days>
<total_seconds>".$age_twt."</total_seconds>
<years>". $twt_years."</years>
<months>".$twt_months."</months>
<days>".$twt_days."</days>
</since_start>
<since_rename>
<total_seconds>".$agehpr."</total_seconds>
@@ -272,7 +272,7 @@ elseif ($format === "xml") {
</age>
<shows>
<total>".$totalshows."</total>
<twat>300</twat>
<twt>300</twt>
<hpr>".$totalhpr."</hpr>
<duration>".$total_duration."</duration>
<human_duration>".$human_total_duration."</human_duration>
@@ -296,17 +296,17 @@ elseif ($format === "csv") {
header("Content-type: text/csv");
header("Content-disposition: inline; filename=hpr_stats.csv");
print "stats_generated,age_start,age_rename,age_since_start_total_seconds,age_since_start_years,age_since_start_months,age_since_start_days,age_since_rename_total_seconds,age_since_rename_years,age_since_rename_months,age_since_rename_days,shows_total,shows_twat,shows_hpr,hosts,slot_next_free,slot_no_media,number_future_hosts,number_future_shows,unprocessed_comments,shows_in_workflow,queue_reserve,duration\n";
print "${current_time},2005-09-19T00:00:00Z,2007-12-31T00:00:00Z,${agetwat},${twat_years},${twat_months},${twat_days},${agehpr},${hpr_years},${hpr_months},${hpr_days},${totalshows},300,${totalhpr},${num_of_hosts},${days_to_wait},${un_delivered},${num_future_hosts},${num_future_shows},${unprocessed_comments},${new_shows},${reserve_shows},${total_duration}\n";
print "stats_generated,age_start,age_rename,age_since_start_total_seconds,age_since_start_years,age_since_start_months,age_since_start_days,age_since_rename_total_seconds,age_since_rename_years,age_since_rename_months,age_since_rename_days,shows_total,shows_twt,shows_hpr,hosts,slot_next_free,slot_no_media,number_future_hosts,number_future_shows,unprocessed_comments,shows_in_workflow,queue_reserve,duration\n";
print "${current_time},2005-09-19T00:00:00Z,2007-12-31T00:00:00Z,${age_twt},${twt_years},${twt_months},${twt_days},${agehpr},${hpr_years},${hpr_months},${hpr_days},${totalshows},300,${totalhpr},${num_of_hosts},${days_to_wait},${un_delivered},${num_future_hosts},${num_future_shows},${unprocessed_comments},${new_shows},${reserve_shows},${total_duration}\n";
}
else {
Header('Content-type: text/tab-separated-values');
header("Content-disposition: inline; filename=hpr_stats.txt");
printf("Started:\t%d years, %d months, %d days ago (2005-09-19)\n", $twat_years, $twat_months, $twat_days);
printf("Started:\t%d years, %d months, %d days ago (2005-09-19)\n", $twt_years, $twt_months, $twt_days);
printf("Renamed HPR:\t%d years, %d months, %d days ago (2007-12-31)\n", $hpr_years, $hpr_months, $hpr_days);
echo "Total Shows:\t" . $totalshows . "\n";
echo "Total TWAT:\t300\n";
echo "Total TWT:\t300\n";
echo "Total HPR:\t" . $totalhpr . "\n";
echo "Duration:\t" . $total_duration . "\n";
echo "Human Duration:\t" . $human_total_duration . "\n";
@@ -318,7 +318,7 @@ else {
echo "Files on the FTP Server:\t$new_shows\n";
echo "Number of Reserve Shows:\t$reserve_shows\n";
echo "Days until show without media:\t$un_delivered\n";
print "$current_time,$agetwat,$agehpr,$totalshows,300,$totalhpr,$num_of_hosts,$days_to_wait,$num_future_hosts,$num_future_shows,$unprocessed_comments,$new_shows,$reserve_shows,$un_delivered";
print "$current_time,$age_twt,$agehpr,$totalshows,300,$totalhpr,$num_of_hosts,$days_to_wait,$num_future_hosts,$num_future_shows,$unprocessed_comments,$new_shows,$reserve_shows,$un_delivered";
// print_r($show_array);
}
mysqli_close($connection);