Skip to content

Instantly share code, notes, and snippets.

@tml
Created October 20, 2011 23:36
Show Gist options
  • Save tml/1302715 to your computer and use it in GitHub Desktop.
Save tml/1302715 to your computer and use it in GitHub Desktop.
#!/usr/bin/php
<?php
/**
* Incrementally downloads all comments from DISQUS.
*
* ``php import-comments.php``
*/
require_once(dirname(__FILE__) . '/../lib/wp-cli.php');
require_once(dirname(__FILE__) . '/../disqus.php');
$forum_url = get_option('disqus_forum_url');
if (empty($forum_url)) {
print_line("Disqus has not been configured on this installation!");
die();
}
print_line('---------------------------------------------------------');
print_line('Discovered DISQUS forum shortname as %s', $forum_url);
print_line('---------------------------------------------------------');
$imported = true;
if (in_array('--reset', $argv)) {
$last_comment_id = 0;
} else {
$last_comment_id = get_option('disqus_last_comment_id');
}
$force = (in_array('--force', $argv));
$total = 0;
$global_start = microtime();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment