Twitter Detective MasterHack: How To Retrospectively Find A User ID Number

I wrote in my Old Usernames article about the importance of Twitter’s User ID in keeping tabs on slippery people’s behaviour. The User ID is a unique account identifier which remains the same however many times the user changes his or her @username. If you know the User ID, you will always be able to find a given Twitter profile (or at least find what’s happened to it) via its numerical URL. The Old Usernames article has more info on the basics.

But what happens if you discover that, say, a group of account @usernames have been switched, and you need to actually prove that the switch has taken place? This can happen with account networks when they try to cloak their origins. And it became important recently when the lead profile in a network of raving political activist accounts rebranded as the main promo feed for an alternative social media platform claiming to be politically impartial. I know, you couldn’t make it up, could you?

I’m not going to publicise the account in question, but it turned out to have gone through at least six @usernames, and it was originally a promo feed for a pitifully unprofessional “travel site”. I wanted, however, to be 100% sure that my old username tracking investigation was entirely accurate. Before I presented the info to anyone else, I needed to be right. And to be absolutely certain, I needed to retrospectively access the User IDs of accounts in the network – as they applied in the past. That would confirm beyond doubt that the usernames had been switched. But how would I get that confirmation?…

WAYBACK MACHINE TO THE RESCUE

The Internet Archive, or Wayback Machine, captures web pages and preserves them for the future. It doesn’t capture everything on the Internet, but when a page gains serious traction, the Archive will almost invariably pick it up.

So with significant Twitter accounts that switch their @usernames, you can find a full representation of the profile pages, as they were at various dates in the past. You can then check the source code for each page and categorically tie the old @username to a User ID. I’ll explain all this so that anyone can do it. You won’t need to understand code.

The one proviso is that the @username(s) you want to review must still exist live on Twitter. The Internet Archive will not display pages that are inaccessible. So if an account bearing one of the @usernames is suspended, or deactivated, you probably won’t find it in the Archive. However, if the @usernames have only been switched and not deleted or zapped, everything is still fair game for the Archive to display.

If one @username has simply been dropped – that is, it doesn’t currently exist on Twitter but is not suspended and is available for re-use – then setting up a NEW account with that @username may restore the ORIGINAL page to the Archive. This obviously depends on whether the Archive captured the original page in the first place though.

Even if you’re not seeking a retrospective User ID, looking up Twitter pages retrospectively on the Internet Archive can be fascinating. You can find how many followers the user had at a point in the past, for example. This is a facet of history that Twitter itself doesn’t inherently reference, but it’s sometimes useful to know. When Twitter had its big bot purges, a lot of the people who’d bought followers, but had always insisted they hadn’t, lost tens of thousands – even hundreds of thousands of followers overnight. It was great fun to check their recent entries on the Internet Archive and measure their exact losses. Indeed, the profile at the centre of the @username-switching episode I was investigating, had itself lost SIX DIGITS of followers during a bot purge.

THE PROCESS

So, returning to the plot, Step 1 in the process is simply to go to the Internet Archive, and enter the full URL of the Twitter page you want to find. I’m using the @google username for my example, and here’s the format of the URL…

htt​ps://twitter.com/google

If the Archive has never captured pages for your chosen @username, you’ll get no results. But if it has, you’ll go to a calendar page, where you can select the year, and then any date for which a capture is available. As seen below…

ACCESSING THE SOURCE CODE

Once you’ve clicked through from the calendar to an actual archived profile page, you see an old version of the page on the URL you entered, like this…

Accessing the source code for that page is easy. Just right-click any blank space on your archive page in any major browser, and select View source code, View page source or similar from the context menu. See below…

This will open up a page of code, which to many people will look like gobbledygook.

DON’T PANIC! You don’t have to make sense of the code page. All you need to do is search for the User ID in your browser’s search box. Here’s how you do it…

FINDING THE USER ID IN THE SOURCE CODE

On the code page, press Ctrl+F to open your browser’s search function. Now you’ll just need to paste a short line of code into that search box. But bear with me for a moment…

The composition of Twitter’s pages has changed over the years, so while the User ID does appear in all of them, the way it’s displayed differs depending on how far you want to go back in time. The good news is that the ID has been displayed in the same way as far back as around early to mid 2013 (a rollout period). So provided you don’t need to reference anything before that, here’s the line you need to enter into your browser’s search box, on the source code page…

similar_to_user_id&q​uot;:

Here’s the actual code page, with the above text pasted into the browser-search box…

When you copy, paste and search that line, you should see it highlighted on the source code page, and there’ll be a number immediately after the highlighted line. That number is the User ID. See the screen shot below…

So now all you do is copy the number (and you ONLY want the number – nothing else), and add it onto the end of this line…

htt​ps://twitter.com/intent/user?user_id=

@google’s User ID for 1st July 2014 was 20536157, so here’s how the complete line would look in my example case…

https://twitter.com/intent/user?user_id=20536157

Now just paste the whole line into your browser URL bar, as shown below…

This is the moment of truth! If you see the same @username and account identity that appears in the Archive, the @username has not been switched. But if you see a different account identity, you have your proof that this account, used to be that account. In the case of @google, we see that the username has not been switched…

If you need to go back further than 2013 on the Archive, you’ll have to search different code phrases in the source code to locate the User ID.

For between around early to mid 2011 and around early to mid 2013, copy, paste and search this line…

data-user-id=

Depending on the date, you may need to go down the page a couple of times until you find one with a number after it.

Before around early to mid 2011, search this line…

statuses/user_timeline/

We can now actually use this very old search to find out something interesting about @google’s Twitter account history. I noticed when inspecting the current @google profile that the join date is February 2009. But the Internet Archive shows the existence of @google tracing back to at least March 2007. That means the earliest Archive entries for @google, between March 2007 and January 2009, must relate to an account with a different ID. So what happened to that original @google account? Has it been repurposed? Let’s find out…

As you can see above, the old User ID was 764150, so let’s see where that now leads…

https://twitter.com/intent/user?user_id=764150

There’s your answer. The old account was deactivated, and is no longer live. But this is a great illustration of the way the Internet Archive can even show us deleted Twitter accounts, as long as the @username still exists somewhere on the current Twitter.

I can’t imagine you’d want to go back before early to mid 2007, but if you do, and the previous code search doesn’t work, search this…

user/profile_image/

So, now you have a nice bit of specialist Twitter detective hacking knowledge, you fiendish genius, you.

Advertisements