Skip to content

Instantly share code, notes, and snippets.

@alexkingorg
Created August 25, 2012 20:25
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save alexkingorg/3470627 to your computer and use it in GitHub Desktop.
Save alexkingorg/3470627 to your computer and use it in GitHub Desktop.
Import a list of tweet ids into Twitter Tools/WordPress.
<?php
foreach (file('/tweet-ids.txt') as $tweet_id) {
$tweet_id = trim($tweet_id);
$url = home_url('index.php').'?'.http_build_query(array(
'aktt_action' => 'import_tweet',
'tweet_id' => $tweet_id,
'social_api_key' => Social::option('system_cron_api_key')
), null, '&');
// error_log('Importing tweet '.$tweet_id.' '.$url);
wp_remote_get(
$url,
array(
'timeout' => 0.01,
'blocking' => false,
'sslverify' => apply_filters('https_local_ssl_verify', true),
)
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment