TwitterClear
- Use TwitterClear to delete all your tweets without deleting your follows/followers.
- TwitterClear will clear up to 100 tweets per hour.
- Re-run it every hour to delete all your tweets.
- It only deletes your tweets (not direct messages or favorites).
- This page is not encrypted. Safeguard your Twitter account by changing your password before and after running TwitterClear.
- Written by Vibol Hou.
Clicking [Clear!] will begin deleting your tweets one at a time.
if ($_POST["username"]) {
flush();
$ch = curl_init();
curl_setopt($ch, CURLOPT_USERPWD, $_POST["username"] . ":" . $_POST["password"]);
curl_setopt($ch, CURLOPT_URL, "http://twitter.com/statuses/user_timeline.rss?count=100");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec($ch);
curl_close($ch);
$feed = new SimplePie();
$feed->enable_cache(false);
$feed->set_raw_data($response);
$feed->init();
$feed->handle_content_type();
$items = $feed->get_items();
echo "- Clearing " . count($items) . " tweets for " . $_POST["username"] . "
\n";
foreach ($items as $item) {
if (connection_aborted()) break;
$val = explode("/", $item->get_link());
$id = $val[5];
echo "- " . $item->get_title() . "...";
$ch = curl_init();
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_USERPWD, $_POST["username"] . ":" . $_POST["password"]);
curl_setopt($ch, CURLOPT_URL, "http://twitter.com/statuses/destroy/{$id}.xml");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec($ch);
$xml = new SimpleXMLElement($response);
if (count($xml->id) > 0)
echo "success.";
if (count($xml->error) > 0) {
echo "failed (try again in an hour).";
die();
}
echo "
\n";
curl_close($ch);
flush();
usleep(1000000);
}
}
?>