-
-
Save zeelorenc/f3ce6e2ac0c2d288c377 to your computer and use it in GitHub Desktop.
translated
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$projectId = 1; // Find your project ID on your about page!!! Example: https://revctrl.com/IrresistibleDev/SF-CNR/about | |
$jsonData = json_decode(file_get_contents("https://www.revctrl.com/api/projects/" . $projectId), true); | |
if ($jsonData) { | |
$latestChangelog = $jsonData['latest_changelog']; | |
$changelogString = "{FFFFFF}Here are latest changes for the most recent update " . $latestChangelog['version'] . ", rolled out on " . $latestChangelog['updated_at'] . ".\n\n"; | |
// Translations | |
$typeArray = [ | |
'addition' => '[french addition]', | |
'removal' => '[french removal', | |
'fix' => '[french fix]', | |
'change' => '[french change]' | |
] | |
foreach ($latestChangelog['revisions'] as $key) { | |
// adds an extra tab to short revision types | |
$extraTab = strlen($typeArray[$key['type']]) < 7 ? "\t" : ""; | |
// appends revision after revision | |
$changelogString .= "{C0C0C0}" . $typeArray[$key['type']] . "{FFFFFF}\t" . $extraTab . html_entity_decode(strip_tags($key['revision'])) . "\n"; | |
} | |
$changelogString .= "\nPlease make sure to follow " . $jsonData['codename'] . " on {C0C0C0}www.revctrl.com/" . $jsonData['creator'] . "/" . $jsonData['codename'] . "{FFFFFF} to stay always up to date!"; | |
echo $changelogString; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment