public
Last active

Import a list of tweet ids into Twitter Tools/WordPress.

  • Download Gist
backfill-tweets.php
PHP
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
<?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),
)
);
}

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.