7

If I know a user name (e.g. "SteveO") whose account was deleted sometime around middle of January this year, is it possible to find out its userid (and thus its current username "user" shown in its posts)? Thanks.

5
  • Might be possible to use dataSE to find comment replies to the user, then look at the comments around it for the generic username stub e.g.: user123456. But why? You wouldn't be able to view the deleted user's profile. Jun 23, 2018 at 3:02
  • There are multiple users with the same user name, but still a possible solution, but I am not very familiar with the databases, and would appreciate if anyone can help. "Why": meta.stackoverflow.com/questions/369989/…
    – Tim
    Jun 23, 2018 at 3:11
  • Are you looking for these? 1224441 9119247 9158584 Jun 23, 2018 at 3:15
  • Thanks. Does 9158584 have any post on SO? and any post which doesn't receive overall downvote?
    – Tim
    Jun 23, 2018 at 3:18
  • Not at all..... Jun 23, 2018 at 3:19

1 Answer 1

8

Beyond what was offered by Erik von Asmuth earlier you can only find out if a user has been relatively active in either commenting but even better, close voting.

The first method relies on the fact that users are @-reply-ed in a comment. You can then create a query that looks for earlier comments on the same post for a user that is deleted. The anonymized (that IS a word!) displayname contains the original userid.

The second method relies on the fact that users that participate in successful close voting (> 3K rep needed) have their userid and displayname recorded in the posthistory table. With some JSON parsing magic you can reveal those.

I have captured both methods in this SEDE query

declare @username varchar(200) = ##userdisplayname:string?H2CO3##

select distinct top 100  
       uc.id as [Comment Link]
     , pv.userdisplayname [potential userid]
from comments uc -- all comments ...
inner join comments pv on pv.postid = uc.postid -- previous comments
                      and pv.id < uc.id
left outer join users u on u.id = pv.userid -- from users ...
where uc.text like concat('@', @username, ' %') -- collate sql_latin1_general_cp1_ci_ai
and u.id is null -- ... that are now deleted


select distinct JSON_Value(ph.text,concat('$.Voters[', num.value , '].Id')) [potential userid] 
from posthistory ph
   , string_split('0,1,2,3,4', ',') num -- [0..4] (max 5 close voters)
where posthistorytypeid = 10  -- closed
and JSON_Value(ph.text,concat('$.Voters[', num.value , '].DisplayName'))  = @username

This is as much as us mortals can do. If this doesn't work for you, either grab an older datadump, run for moderator or get hired as SE Dev.

Let me mention here that some countries have legislation that allow their citizens to be forgotten. If users have chosen to delete their account that has to be respected. Don't use these techniques to hunt down, online or in real life, users and confront them with posts they no longer wanted to be associated with.

3
  • Thanks. How shall I learn to use SEDE? One part I need to be familiar with T-SQL. The other I need to learn about the schemas of the tables in the databases available in SEDE. Correct? How would you approach the two parts? For example, nice books to learn T-SQL (I am more familiar with postgresql)? links to schemas of the tables ?
    – Tim
    Jun 23, 2018 at 16:13
  • 4
    @Tim I recommend to get started with the SEDE tutorial which is written by Monica. The SEDE tag on MSE is pretty filled with loads of queries and beyond the schema documentation you'll find one post where I have done an ERD.
    – rene
    Jun 23, 2018 at 17:32
  • It is indeed a word but spelled differently. I happend to know the equivalent German word so I looked it up. Here's the result: dict.leo.org/englisch-deutsch/anonymisiert -> anonymized
    – Mafii
    Jun 25, 2018 at 7:25

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .