Skip to content

Instantly share code, notes, and snippets.

@alexkingorg
Created August 25, 2012 20:25
Show Gist options
  • Select an option

  • Save alexkingorg/3470627 to your computer and use it in GitHub Desktop.

Select an option

Save alexkingorg/3470627 to your computer and use it in GitHub Desktop.

Revisions

  1. Alex King created this gist Aug 25, 2012.
    19 changes: 19 additions & 0 deletions backfill-tweets.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,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),
    )
    );
    }