{"id":1118,"date":"2009-02-13T21:39:27","date_gmt":"2009-02-14T04:39:27","guid":{"rendered":"http:\/\/www.gubatron.com\/blog\/?p=1118"},"modified":"2009-02-13T21:39:27","modified_gmt":"2009-02-14T04:39:27","slug":"delete-all-direct-messages-of-your-twitter-account-at-once-or-at-least-try","status":"publish","type":"post","link":"https:\/\/www.gubatron.com\/blog\/delete-all-direct-messages-of-your-twitter-account-at-once-or-at-least-try\/","title":{"rendered":"Delete All Direct Messages of your Twitter Account at once (or at least try!)"},"content":{"rendered":"<p><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/farm4.static.flickr.com\/3421\/3278210662_801cd1a20e_o.png?w=640\" class=\"alignleft\">Since Twitter doesn&#8217;t provide with a &#8220;Delete All Direct Messages&#8221; functionality, <a href=\"http:\/\/www.gubatron.com\/blog\/wp-content\/uploads\/2009\/02\/twitter_delete_direct_messages.txt\">Here&#8217;s a Python script<\/a> that attempts to delete all the direct messages stored on your Twitter account.<\/p>\n<p><strong>Limitations<\/strong><br \/>\nThe only problem with it is that given the limitations of the <a href=\"http:\/\/apiwiki.twitter.com\/REST+API+Documentation\">Twitter REST API<\/a>, I was forced to send a request per message to be deleted, and it seems that Twitter will only allow 100 requests per hour (per client).<\/p>\n<p>So in theory you will be able to delete 100 an hour, although I have seen it delete over 400 messages Twitter gets all grumpy on me.<\/p>\n<p><strong>Usage<\/strong><br \/>\nJust save the script as <strong>twitter_delete_direct_messages.py<\/strong>, open a terminal and run it:<\/p>\n<p>[bash]python twitter_delete_direct_messages.py[\/bash]<\/p>\n<p>After that just follow the instructions on screen and enjoy as messages get wiped out.<\/p>\n<p>If you find this useful, you can thank me by <a href=\"http:\/\/twitter.com\/gubatron\">following me<\/a> on Twitter.<\/p>\n<p><a href=\"http:\/\/www.gubatron.com\/blog\/wp-content\/uploads\/2009\/02\/twitter_delete_direct_messages.txt\">Get The Script<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Since Twitter doesn&#8217;t provide with a &#8220;Delete All Direct Messages&#8221; functionality, Here&#8217;s a Python script that attempts to delete all the direct messages stored on your Twitter account. Limitations The only problem with it is that given the limitations of the Twitter REST API, I was forced to send a request per message to be [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[15,30,39],"tags":[152,330,736,740,1458,908,1462],"class_list":["post-1118","post","type-post","status-publish","format-standard","hentry","category-code","category-geeklife","category-internet","tag-application-programming-interface","tag-delete","tag-on-the-web","tag-online-communities","tag-python","tag-social-networking","tag-twitter"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p5Unzf-i2","jetpack-related-posts":[{"id":3970,"url":"https:\/\/www.gubatron.com\/blog\/removing-duplicate-records-from-a-table-in-sqlite3-when-delete-doesnt-support-limit-1\/","url_meta":{"origin":1118,"position":0},"title":"Removing duplicate records from a table in Sqlite3 when &#8220;DELETE&#8221; doesn&#8217;t support &#8220;LIMIT 1&#8221;","author":"gubatron","date":"March 6, 2022","format":false,"excerpt":"","rel":"","context":"In &quot;Code&quot;","block_context":{"text":"Code","link":"https:\/\/www.gubatron.com\/blog\/category\/code\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1015,"url":"https:\/\/www.gubatron.com\/blog\/python-script-to-update-wordpress-in-one-step\/","url_meta":{"origin":1118,"position":1},"title":"Python Script to Update WordPress in One Step","author":"gubatron","date":"November 26, 2008","format":false,"excerpt":"During the past week, I think I had to update all my wordpress instances twice, and it's become really annoying doing this manually. I've written a python script which I'll share with you. How I keep my wordpress updated by hand I tend to keep my wp-content folder outside of\u2026","rel":"","context":"In &quot;Code&quot;","block_context":{"text":"Code","link":"https:\/\/www.gubatron.com\/blog\/category\/code\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":2749,"url":"https:\/\/www.gubatron.com\/blog\/deploying-html5-apps-on-cloudfront-with-efficient-invalidation-requests\/","url_meta":{"origin":1118,"position":2},"title":"Deploying HTML5 apps on CloudFront with efficient invalidation requests","author":"gubatron","date":"June 8, 2012","format":false,"excerpt":"So you decided to build your next web app\/site using nothing but HTML5 and Javascript. No server side processing for anything related to UI. This means you will be coding a lot of JavaScript. Wouldn't it be nice to put all that static HTML and JS on your CloudFront CDN\u2026","rel":"","context":"In &quot;Code&quot;","block_context":{"text":"Code","link":"https:\/\/www.gubatron.com\/blog\/category\/code\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":516,"url":"https:\/\/www.gubatron.com\/blog\/ejemplo-de-automatizacion-entre-2-maquinas-remotas-con-bash-scripting-y-python\/","url_meta":{"origin":1118,"position":3},"title":"Ejemplo de automatizacion entre 2 maquinas remotas con bash scripting y Python","author":"gubatron","date":"May 10, 2007","format":false,"excerpt":"Para los amigos que se inician en el mundo *nix, ya sea con su nueva Mac, o con una PC corriendo Linux, les recomiendo que aprendan a manejar bien los siguientes lenguajes, y el mundo sera suyo: - bash scripting (aliases, variables, exports, iteraciones, condicionales) - python (para programar logica\u2026","rel":"","context":"In &quot;Code&quot;","block_context":{"text":"Code","link":"https:\/\/www.gubatron.com\/blog\/category\/code\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":4017,"url":"https:\/\/www.gubatron.com\/blog\/4017\/","url_meta":{"origin":1118,"position":4},"title":"Mass delete Github Workflow Run Logs with this script","author":"gubatron","date":"February 27, 2023","format":false,"excerpt":"Github workflow doesn't allow mass deletion of Workflow Action run logs, it takes 2 clicks to delete each run log. If you wanted to delete hundreds of these, the only way is to script something. Luckily you can do so using the gh Github Command Line Tool and some json\u2026","rel":"","context":"In &quot;Code&quot;","block_context":{"text":"Code","link":"https:\/\/www.gubatron.com\/blog\/category\/code\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.gubatron.com\/blog\/wp-content\/uploads\/2023\/02\/Screenshot-2023-02-27-at-8.50.39-AM.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":2767,"url":"https:\/\/www.gubatron.com\/blog\/ubuntu-packages-for-a-kick-ass-web-server\/","url_meta":{"origin":1118,"position":5},"title":"ubuntu packages for a kick ass web server","author":"gubatron","date":"September 7, 2012","format":false,"excerpt":"Copy and paste the following list on a file, say \"packages.txt\". To install all just do: sudo apt-get install $(cat packages.txt) accountsservice acpid adduser ant ant-optional apache2-utils apparmor apport apport-symptoms apt apt-transport-https apt-utils apt-xapian-index aptitude at base-files base-passwd bash bash-completion bc bind9-host bsdmainutils bsdutils busybox-initramfs busybox-static byobu bzip2 ca-certificates ca-certificates-java\u2026","rel":"","context":"In &quot;Code&quot;","block_context":{"text":"Code","link":"https:\/\/www.gubatron.com\/blog\/category\/code\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"https:\/\/www.gubatron.com\/blog\/wp-json\/wp\/v2\/posts\/1118","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.gubatron.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.gubatron.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.gubatron.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.gubatron.com\/blog\/wp-json\/wp\/v2\/comments?post=1118"}],"version-history":[{"count":0,"href":"https:\/\/www.gubatron.com\/blog\/wp-json\/wp\/v2\/posts\/1118\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.gubatron.com\/blog\/wp-json\/wp\/v2\/media?parent=1118"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gubatron.com\/blog\/wp-json\/wp\/v2\/categories?post=1118"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gubatron.com\/blog\/wp-json\/wp\/v2\/tags?post=1118"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}