(this used to be a blog)

How to read tweets from users who have blocked you

Posted: June 17th, 2009 | Author: Panos Karageorgakis | Filed under: Twitter | Tags: | 2 Comments »

You may be all nice and sugar on Twitter, but at times people go mad and may block you. It happens. Once they block you, their updates do not appear in your friends’ timeline; but provided that they’re not protected by the user, here’s a trick you can do to get them back to your feed.

The idea

The idea is pretty simple. First, let’s name the players: we will call the person who blocked you the Hostile, and refer to you as, well, You. You will also need to create a new dummy account on Twitter, which we will refer to as Dummy. So, in essence, it works like this:

  • Dummy follows nobody
  • You follow Dummy
  • Dummy has its updates protected, and only You are authorized to read them
  • You install a script that fetches the updates (tweets) of the Hostile and posts them as Dummy
  • Hostile’s updates appear in your timeline as Dummy

What you’ll need

To do this trick, you will need to:

  1. download and copy a special Perl script file to your computer
  2. install the Perl Net::Twitter library in your computer
  3. create a new dummy Twitter account
  4. test that everything is working
  5. make it run periodically (i.e. via cron)
  6. have the computer always on and connected to the Internet (or install it to your server)

Required computer skills: intermediate / advanced.

If you feel geeky

Should you be familiar with crontabs and Perl here’s a chance to save a minute skimming the rest of this article and get the quick instructions in one paragraph. If not, move on to the next section.

Create a new account on Twitter, protect its updates, follow it with your primary account and authorize yourself. Then, you’ll have to download the perl script you’ll find later on in this page on your hard drive. You can place it anywhere you like. You invoke it as follows:

perl twtproxy.pl dummy_username dummy_password hostile_username

Decide how often you need to run the script and enter the command in your crontab. (When the script is run, it creates a hidden .twtproxy_<hostileusername>.txt file in your home dir to store the last tweet id.) In order for it to run, though, you’ll have to also install the Net::Twitter perl library to your computer. You can run different instances to proxy different users.

Instructions for the non-geeks

If you don’t think the last section got you covered, here’s a somewhat more detailed instructions list for you. Keep in mind though that I will not get really deep into the details because that would make the article really really long (and would require too much time to write as well). The following instructions assume you’re either running Mac OS X or some *NIX flavor (if you’re on Windows, you’ll have to figure out how to do it). So there we go!

1. Grab the script

Download the following perl script. It’s a simple text file, so you can either copy and paste the contents to a file named twtproxy.pl or click on “Raw” to download it (you may have to right click on the link and select to save the target file).

It doesn’t matter where you store the file or how you rename it. Just remember where you put it, we will need the path to it later.

2. Install the Net::Twitter library

This is the toughest part. You have to either grab the files from the Net::Twitter page or use cpan to install it automatically. The library depends on several other libraries that you also have to install. Unfortunately, I won’t go into any details here since I’m no perl expert. Suffice it to say that I did a sudo cpan -i Net::Twitter command on my terminal, then copied the files manually from the downloaded package to the Mac perl library. I have no idea if that was the correct way to do it. If you know a better way, please let us know in the comments and I’ll update this section accordingly.

3. Create a dummy Twitter account

Go to Twitter, log out (if you’re already logged in) and create a new account. Twitter allows you to have multiple accounts, but you can’t use the same e-mail address you’re already using in your other account. It doesn’t matter what username, real name etc you give to your proxy. You could name it to something similar to the Hostile username (so you know what it is, when you see it in your feed later) but then again keep in mind that this may raise suspicions to the Hostile if they ever see your account.

Protect updatesOnce you have created your Dummy account, go to Settings and check the “Protect my updates” checkbox. Hit save. Now log in to your primary Twitter account and navigate to the Dummy account page (twitter.com/your_dummy_username) and request to follow this user. Log out again. Check the Dummy account’s e-mail, you should have an e-mail from Twitter telling you that someone (your primary account) would like to follow you. Click on the link to authorize the request.

So what you have done in this step, is to create a Dummy account whose posts can be seen only by you (as your primary account). If you don’t do this, and allow anyone to read the Dummy updates, there’s a chance the Hostile would find out that Dummy is copying their tweets and maybe block Dummy as well.

4. All set! Let’s test it out.

In order to test if the script is working, log in to Twitter (via the web or your favorite client) as your primary account. We’re going to run the script once, and instruct it to proxy the Hostile’s latest tweets. If it works, you’re going to see them being posted by the Dummy account, appearing in your feed.

Launch a terminal, go to the directory (folder) where the twtproxy.pl file resides, and issue this command:

perl twtproxy.pl dummy_username dummy_password hostile_username

Don’t copy paste this! You’ll have (of course) to replace dummy_username with the username of your Dummy account, etc. If you run the script and nothing happens, then it probably worked. If any error messages appear, then something’s broken. But in case it works, refresh your Twitter feed and you should see the blocked person’s latest updates appearing as your Dummy account. Voila.

Now, if you run the script again, you won’t get more tweets until the Hostile has posted something new. The script creates a hidden file in your home directory where it stores the id of the last tweet Hostile has posted. Upon consecutive executions, it is checking for the latest posts that are newer to that last tweet, so you only get the latest posts.

5. Create a cron job so the script runs in the background

This is not a trivial task. If you’re on Mac OS X, you can search for a GUI front end to cron jobs, or attempt to do it the hard way, which is: you have to create a new text file, including a line similar to this one:

*/1	*	*	*	*	perl ~/twtproxy.pl dummy_username dummy_password hostile_username

and name it, for example, mycrontab.

The number in the first column (*/1) represents the frequency of the script’s execution in minutes. In this example, it will run every minute. You can change this to a higher number if you wish less frequent updates. The other asterisks are used to determine the frequency in days, weeks etc, but we won’t go into this detail here.

The ~ assumes that you have copied the script to your home folder. You can substitute it with the full path to where it resides on your hard disk. Also, note that you’ll have to insert a tab in between the fields of this line (not multiple spaces!). Sorry, but this is UNIX stuff, don’t blame me.

Once you’ve created this file, issue this command:

crontab mycrontab

(assuming that you did name your text file mycrontab). This command will read the file and create a permanent cron job, essentially telling the OS to run this command every minute (or as frequently as you told it).

Now, like I said, this is not trivial stuff. You should better look for a graphical way to create cronjobs if you feel unfamiliar with all this.

6. Let it flow

That’s it! If all the previous steps have succeeded, you’re done. Of course, since you’re running this script on your computer, it goes without saying that it will be effective only as long as your computer is turned on and connected to the Internet. In case you’re renting a space in a hosting server or have access to any other server, you can try to install it there (since that server is always on). The script is rather harmless and very light on resources so it won’t cause any troubles.

Remember

Perhaps it’s a good time at this point to think back and wonder “why did the Hostile block me in the first place?”. Did you say something to hurt them, or failed to behave properly? A little bit of introspection and an attempt to make ourselves better, never hurts.

Of course, there are other times when people just block you because they don’t like you telling them what they really are. However, I don’t see any reason to get into all this just to recover the tweets of any person (hey, if they blocked you, block them back and move on). But there could be cases (like mine) where I got blocked my a news-posting account, and even though I don’t like the guy who owns that thing, I find their news useful to read.

I hope you’ll never need to try this out, but if you do, I hope it works for you. The script is barely minimal at the moment, but it works. If enough interest is drawn to this technique, I will implement more features and maybe even re-write this post to be more helpful.

Share this post:
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • Twitter

2 Comments on “How to read tweets from users who have blocked you”

  1. 1 Artesy said at 6:53 pm on July 6th, 2009:

    Perfect!

  2. 2 Samjosh said at 6:24 pm on May 3rd, 2010:

    Lovely!


Leave a Reply