Skip to content

Instantly share code, notes, and snippets.

@gka
Last active August 29, 2015 13:56
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gka/9178836 to your computer and use it in GitHub Desktop.
Save gka/9178836 to your computer and use it in GitHub Desktop.
Script for publishing Datawrapper charts via command-line
<?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