Terence Eden’s Blog<p><strong>Exploring BlueSky's Domain Handles</strong></p><p>Hot new social networking site BlueSky has an interesting approach to usernames. Rather than just being <code>@example</code> you can verify your domain name and be <code>@example.com</code>! Isn't that exciting?</p><p>Some people are <code>@whatever.tld</code> and others are <code>@cool.subdomain.funny.lol.fwd.boring.tld</code></p><p>I wanted to know what the distribution is of these domain names. For example, are there more .uk users than .org users?</p><p><strong>Shut up and show me the results</strong></p><p><a href="https://edent.github.io/bsky-domain-graphs/treemap.html" rel="nofollow noopener noreferrer" target="_blank"></a></p><p>You can <a href="https://edent.github.io/bsky-domain-graphs/treemap.html" rel="nofollow noopener noreferrer" target="_blank">play with the interactive data</a></p><p><strong>Getting the data</strong></p><p>BlueSky has an open "firehose" of the data passing through it. Following <a href="https://github.com/MarshalX/atproto/blob/main/examples/firehose/process_commits_async.py" rel="nofollow noopener noreferrer" target="_blank">the sample code</a> I listened for <em>public</em> interactions - people posting, liking, or follows.</p><p>From there, I grabbed every username which wasn't on the default <code>.bsky.social</code> domain. I left the code running for a few days until I had over 22,000 usernames.</p><p>Note, these data are all public - although I'm not sure if users necessarily realise that. It doesn't include lurkers (people who don't interact). Some of the accounts may have been moved, banned, or deleted.</p><p><strong>Drawing a TreeMap</strong></p><p>I used <a href="https://plotly.com/python/treemaps/" rel="nofollow noopener noreferrer" target="_blank">Plotly's TreeMap library</a> to draw a static map of all the Top Level Domains (TLD).</p><p>As you can see, .com dominates the landscape - but there are quite a few country code TLDs in there as well.</p><p><strong>Public Suffixes</strong></p><p>Domain names have the concepts of <a href="https://publicsuffix.org/" rel="nofollow noopener noreferrer" target="_blank">Public Suffixes</a>. For example, users can register domains at .co.uk and .org.uk as well as just plain .uk. The <a href="https://pypi.org/project/tldextract/" rel="nofollow noopener noreferrer" target="_blank">Python <code>tldextract</code> library</a> allowed me to see which domains were public suffixes, so I could attach them to their parent TLD.</p><p>I then drew a TreeMap showing this.</p><p><a href="https://edent.github.io/bsky-domain-graphs/public-suffix.html" rel="nofollow noopener noreferrer" target="_blank"></a></p><p>Note! You'll need to <a href="https://community.plotly.com/t/ignore-non-leaves-rows-for-sunburst-diagram/60789" rel="nofollow noopener noreferrer" target="_blank">hack your Plotly installation to allow empty leaf nodes</a> to get in the same style as the first map.</p><p><strong>So what? What next?</strong></p><ul><li>Not everyone from, say, Brazil will have a .br domain name - but it is fascinating to see which countries dominate.</li><li>It might be fun to go full "Information Is Beautiful" and turn each ccTLD into its country's flag.</li><li>Are there ethical implications of recording the fact that an account has publicly shared themselves on a social network?</li><li>What percentage of all users have a domain name handle?</li></ul><p><strong>Get the code</strong></p><p>Everything is <a href="https://github.com/edent/bsky-domain-graphs" rel="nofollow noopener noreferrer" target="_blank">open source on GitHub</a>.</p><p><a rel="nofollow noopener noreferrer" class="hashtag u-tag u-category" href="https://shkspr.mobi/blog/tag/bluesky/" target="_blank">#BlueSky</a> <a rel="nofollow noopener noreferrer" class="hashtag u-tag u-category" href="https://shkspr.mobi/blog/tag/data/" target="_blank">#data</a> <a rel="nofollow noopener noreferrer" class="hashtag u-tag u-category" href="https://shkspr.mobi/blog/tag/domains/" target="_blank">#domains</a> <a rel="nofollow noopener noreferrer" class="hashtag u-tag u-category" href="https://shkspr.mobi/blog/tag/visualisation/" target="_blank">#visualisation</a></p>