Skip to content

Instantly share code, notes, and snippets.

@zeelorenc
Created August 27, 2015 14:33
Show Gist options
  • Save zeelorenc/f3ce6e2ac0c2d288c377 to your computer and use it in GitHub Desktop.
Save zeelorenc/f3ce6e2ac0c2d288c377 to your computer and use it in GitHub Desktop.
translated
<?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