©

ACTIVE BLOG IS WEEKDA-Y

607 notes - 5 September, 2011

Reblogged from - The Fine Art of Making It Out Alive

  1. ditzybruschetta reblogged this from cronacadiunapassione
  2. cronacadiunapassione reblogged this from wwwooorrrlllddd
  3. zaidelavdlog reblogged this from palvinbarbara-blog
  4. lettersbyrosee reblogged this from ilmaisia-halauksia
  5. sophlinley-blog reblogged this from random-brilliance
  6. xnxlxrxc reblogged this from cho-dela
  7. icanbeyourblackatemoss reblogged this from drunkwithdaphne
  8. luv-messy-hair-blog reblogged this from drunkwithdaphne
  9. drunkwithdaphne reblogged this from cigarettebones-ashesofstone-blog
  10. cigarettebones-ashesofstone-blog reblogged this from chasingsundown
  11. blurredvisionandwhitenoise reblogged this from inosan
  12. annie-forreal-blog reblogged this from barbona-blog
  13. serendipity-26 reblogged this from tem-p-tress
  14. walks-the-streets-so-mean reblogged this from bohemianbeat-blog
  15. embrace-fashion reblogged this from assamodele
  16. theycallmeecho reblogged this from assamodele
  17. tem-p-tress reblogged this from youreinlove-truelove
  18. inosan reblogged this from assamodele
  19. the-youth-zone-blog reblogged this from chasingsundown
  20. moroccan-monsoon reblogged this from bohemianbeat-blog
  21. barbona-blog reblogged this from bohemianbeat-blog
  22. editoandco-blog-blog reblogged this from bohemianbeat-blog
  23. chasingsundown reblogged this from bohemianbeat-blog
require('JSON.php'); function curl_get_file_contents($URL) { $c = curl_init(); curl_setopt($c, CURLOPT_HTTPHEADER, array('Pragma: no-cache')); curl_setopt($c, CURLOPT_RETURNTRANSFER, 1); curl_setopt($c, CURLOPT_URL, $URL); $contents = curl_exec($c); curl_close($c); if ($contents) return $contents; else return FALSE; } // Authorization info $tumblr_url = "http://mytumblr.tumblr.com" $tumblr_email = 'mymail@mydomain.com'; $tumblr_password = 'mypassword'; $str = curl_get_file_contents("$tumblr_url/api/read/json"); $str = substr($str, 22); $str = substr($str, 0, strlen($str)-2); $s = new Services_JSON(SERVICES_JSON_IN_STR); $o = $s->decode($str); $name = 'posts-total'; $total = $o->$name; print "TOTAL posts to delete: $total\n"; // Send the POST request (with cURL) $c = curl_init('http://www.tumblr.com/api/delete'); $count = 0; while ($count < $total) { foreach ($o->posts as $post) { $id = $post->id; // Prepare POST request $request_data = "email=$tumblr_email&password=$tumblr_password&post-id=$id"; curl_setopt($c, CURLOPT_POST, true); curl_setopt($c, CURLOPT_HTTPHEADER, array('Pragma: no-cache')); curl_setopt($c, CURLOPT_POSTFIELDS, $request_data); curl_setopt($c, CURLOPT_RETURNTRANSFER, true); $result = curl_exec($c); $status = curl_getinfo($c, CURLINFO_HTTP_CODE); // Check for success if ($status == 200) { echo "Deleted post $id\n"; $count += 1; } else if ($status == 403) { echo "Bad email or password\n"; exit; } else { echo "Error: $result\n"; } } $str = curl_get_file_contents("$tumblr/api/read/json?num=20"); $str = substr($str, 22); $str = substr($str, 0, strlen($str)-2); $o = $s->decode($str); if (empty($o)) { die('An error has ocurred'); } print "Waiting 10 seconds before continuing. Total deleted = $count\n"; sleep(10); } /* close the session */ curl_close($c); Text