#!/usr/bin/env php . */ /* * Run this from INSTALLDIR/plugins/OStatus/scripts */ define('INSTALLDIR', realpath(dirname(__FILE__) . '/../../..')); $shortoptions = 'd'; $longoptions = array('dry-run'); $helptext = <<sub_state = 'subscribe'; $feedsub->whereAdd('created < DATE_SUB(NOW(), INTERVAL 1 HOUR)'); $feedsub->find(); $cnt = 0; while ($feedsub->fetch()) { echo "----------------------------------------------------------------------------------------\n"; echo ' feed: ' . $feedsub->uri . "\n" . ' hub uri: ' . $feedsub->huburi ."\n" . ' subscribe date: ' . date('r', strtotime($feedsub->created)) . "\n"; if (!$dry) { $feedsub->delete(); echo " (DELETED)\n"; } else { echo " (WOULD BE DELETED)\n"; } echo "----------------------------------------------------------------------------------------\n"; $cnt++; } if ($cnt == 0) { echo "None found.\n"; } else { echo "Deleted $cnt bogus hub URIs.\n"; } echo "Done.\n";