Skip to content

Instantly share code, notes, and snippets.

@alexkingorg
Created August 25, 2012 20:25
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