Exemplo n.º 1
0
     }
     $cron->store_cron_log(1, $c1 . ' ' . $f_txt1 . $cron_txts[6], '');
     $cron->store_cron_log(1, $c2 . ' ' . $f_txt2 . $cron_txts[6], '');
     //Update user to indicate first pass done
     $cron->set_first_pass_done_db();
 } elseif ($cron->get_first_pass_done() == 1 and $cron->get_fr_fw_issue() == 0) {
     /*
     Decided in the end that if there is an API error, not doing anything at all is probably
     safest. Disabling auto-follow alone is fine, but for a large account an API connection
     failure for the friends and followers list could mean a lot of entries being added to
     the user cache.
     */
     //Get array of new users
     $fw_fr_types = array('fw_new' => $cron_txts[7], 'fw_gone' => $cron_txts[8], 'fr_new' => $cron_txts[9], 'fr_gone' => $cron_txts[10]);
     $data_array = array();
     $data_array = $cron->get_id_changes();
     //Loop through and log data
     foreach ($fw_fr_types as $key => $text) {
         if (sizeof($data_array[$key]) > 0) {
             //Log row
             if (sizeof($data_array[$key]) == 1) {
                 $text = str_replace($cron_txts[11], $cron_txts[12], $text);
             }
             $cron->store_cron_log(1, sizeof($data_array[$key]) . $text, $data_array[$key], 1);
             //Store users for lookup later
             foreach ($data_array[$key] as $this_twitter_id) {
                 $tw_user_cache = array('twitter_id' => $this_twitter_id);
                 $db->store_cached_user($tw_user_cache);
             }
         }
     }