Last active
August 29, 2015 13:56
-
-
Save gka/9178836 to your computer and use it in GitHub Desktop.
Script for publishing Datawrapper charts via command-line
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 | |
/* | |
* This scripts triggers the chart publication process. | |
* Usage: php publish-chart.php [CHART_ID] | |
*/ | |
define('ROOT_PATH', '../'); // relative path to your Datawrapper root | |
define('NO_SLIM', 1); | |
define('NO_SESSION', 1); | |
date_default_timezone_set('Europe/Berlin'); | |
require_once ROOT_PATH . 'lib/bootstrap.php'; | |
require_once ROOT_PATH . 'lib/utils/chart_publish.php'; | |
$chart_id = $argv[1]; | |
$chart = ChartQuery::create()->findPK($chart_id); | |
publish_chart($chart->getUser(), $chart, true); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment