Crawlicious | tools for web business

CAT | twitter tools

How To Delete Annoying Twitter Direct Messages

If you have used twitter for very long then you know that some people really enjoy sending direct messages (DMs).  This is very annoying to me because they are usually just spam and the person wants me to click on their ad or something.  Now, don’t get me wrong, I am not opposed to ads.  In fact a targeted ad for something that I am interested in is very valuable to me.  I just don’t like broadcast spam that fills my inbox.  I am not kidding when I tell you that I had to delete 2,003 DMs from my twitter account today.  It was a pain at first, until I built a little tool to do it.  Now, from my tool it is very easy.  This tool is a python script that you run from the command line.  Remember, that python must be in your PATH for this to work, if it is not, then you will have to add it, or run python by specifying the whole path.  This will work Linux, Windows, Mac, etc, you just have to install python first.

So, here is how you delete all DMs.


python twitter_tool.py delete myuser mypass all

How To Run The Twitter List Messages / Delete Messages

Obviously my script is called twitter_tool.py here are the syntax help messages.

syntax: twitter_tool.py [list | delete ] twituser twitpass [ maxmessages | all ]

In the syntax message, you can list or delete all your messages, or up to a certain number of messages.  A nice way to run it is where you view 10 messages, then delete them, then repeat.  Like this…


$ python twitter_tool.py list myuser mypass 10

from: blablabla date: Sat Nov 14 22:53:14 +0000 2009
You Can Find It Here

http://somespammylink.spam

-----------------------------------------

$ python twitter_tool.py delete myuser mypass 10

deleting message 559771108 from blablabla

$

How To Run The Twitter Unfollow Command

Now what if I am cruising through my messages and I spot something that is really offensive or spammy and I just want to get away from that user.  I can easily unfollow them with the same tool.  Here is an example.


python twitter_tool.py unfollow myuser mypass SomeAnnyoingUser

The End

Well, that is it. A simple tool that does 3 jobs. And you are welcome to download and use the tool.
Click here to get twitter_tool.py

*** UPDATE *** Click here to get twitter_tool.py that has the ability to search for other twitter users… For example, to search for people with the word snowboard in their name, you would do this


python bin/twitter_tool.py searchpeople myuser mypass snowboard

NOTE: you will probably have to Right Click -> Save As to get the file, then save it as twitter_tool.py (i.e. you must remove the .txt extension).

Follow @bigconcept on Twitter

No tags Hide

Find it!

Theme Design by devolux.org