} $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); } } } //Update flags to indicate cross matches $db->query("UPDATE " . DB_PREFIX . "fw_" . $q1a['id'] . " fw, " . DB_PREFIX . "fr_" . $q1a['id'] . " fr SET fw.otp = 1, fr.otp = 1 WHERE fw.twitter_id = fr.twitter_id AND fw.stp = 1 AND fr.stp = 1"); //Unfollow people who aren't following if ((int) $q1a['auto_unfollow'] == 1 and $cron->get_fr_fw_issue() == 0) { //Get array of ids not to unfollow $never_unfollow = array(); $never_unfollow = $cron->get_id_exclusions(1); //Loop through IDs we're following, but that aren't in followers table $unfollow_now = array(); $qheck = $db->query("SELECT twitter_id FROM " . DB_PREFIX . "fr_" . $q1a['id'] . " WHERE otp = 0 AND stp = 1"); while ($qchecka = $db->fetch_array($qheck)) { if (!in_array($qchecka['twitter_id'], $never_unfollow)) { $unfollow_now[] = (string) $qchecka['twitter_id']; } } //If we have people to unfollow, do so now if (sizeof($unfollow_now) > 0) { foreach ($unfollow_now as $this_id) { //Execute unfollow - not rate limited $content = $connection->post('friendships/destroy', array('user_id' => $this_id)); if ($connection->http_code == 200) { //Make use of the fact friendship create/destroy returns said user