diff options
author | Brion Vibber <brion@pobox.com> | 2010-04-09 12:01:53 -0700 |
---|---|---|
committer | Brion Vibber <brion@pobox.com> | 2010-04-09 12:01:53 -0700 |
commit | f4ad0acd8450a322d4a5d54b7e8e4baee75de3e5 (patch) | |
tree | dd6d7519535573f28302287967fb697fc59c6861 /scripts/strip_geo.php | |
parent | 80bd77ced34ff87f5da2739e8ee95d627741d3bf (diff) | |
parent | b47fc9c0bcd9f37438d2aaeb7b5bc98183b554ea (diff) |
Merge branch 'master' of git@gitorious.org:statusnet/mainline into testing
Diffstat (limited to 'scripts/strip_geo.php')
-rwxr-xr-x | scripts/strip_geo.php | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/scripts/strip_geo.php b/scripts/strip_geo.php index 010fb31f5..b3f27be61 100755 --- a/scripts/strip_geo.php +++ b/scripts/strip_geo.php @@ -21,7 +21,7 @@ define('INSTALLDIR', realpath(dirname(__FILE__) . '/..')); $shortoptions = 'i::n::y'; -$longoptions = array('id=', 'nickname=', 'yes', 'dry-run'); +$longoptions = array('id=', 'nickname=', 'yes', 'dry-run', 'all'); $helptext = <<<END_OF_HELP strip_geo.php [options] @@ -31,6 +31,8 @@ Removes geolocation info from the given user's notices. -n --nickname nickname of the user -y --yes do not wait for confirmation --dry-run list affected notices without deleting + --all run over and decache all messages, even if they don't + have geo data now (helps to fix cache bugs) END_OF_HELP; @@ -67,10 +69,14 @@ if (!have_option('y', 'yes') && !have_option('--dry-run')) { } // @fixme for a very prolific poster this could be too many. -print "Finding notices with geolocation data..."; $notice = new Notice(); $notice->profile_id = $profile->id; -$notice->whereAdd("lat != ''"); +if (have_option('--all')) { + print "Finding all notices by $profile->nickname..."; +} else { + print "Finding notices by $profile->nickname with geolocation data..."; + $notice->whereAdd("lat != ''"); +} $notice->find(); if ($notice->N) { @@ -101,10 +107,10 @@ if ($notice->N) { $ok = $update->query($query); if ($ok) { // And now we decache him manually, as query() doesn't know what we're doing... - $orig->blow(); + $orig->decache(); echo "(removed)"; } else { - echo "(failed?)"; + echo "(unchanged?)"; } } print "\n"; |