Mastodon Verification of CodePen Profiles

Category Image 052

TL;DR — If you link to your Mastodon profile from CodePen, and your CodePen profile from Mastodon, your Mastodon profile will display your CodePen profile as a verified link, proving ownership.

How does that work? It’s just HTML!

There is a rel attribute that can go on anchor (<a>) links. The values for rel have a variety of functionality. For example, you can tell search engines not to follow or rank a link and that it is user-generated:

<a 
  href="https://user-generated.com" 
  rel="nofollow ugc">
    User Link
</a>

There are safety and performance-gaining possibilities for using values like noreferrer and noopener as well.

Here’s another value: rel="me" (you can space-separate multiple values). The me value is a rather old-school Microformats thing. It’s pretty neat! The purpose is that you put it on links that point to other things that you own or control. Then, if the link you’re pointing to points directly back also with a rel="me" link that is a verification-of-ownership situation. As the wiki puts it:

Thus establishing a bi-directional rel-me link and confirming that the two URLs represent the same person.

The federated social networking site Mastodon (here’s me!) uses this exact setup to verify personal links. Here’s an image of my Mastodon profile:

Notice there are three links, the first two of which are highlighted with checkmarks and green:

Those “verified” links are verified because they follow the bi-directional rel="me" linking exactly as Mastodon requires.

On CodePen, we’re now adding that me value to all the links you add to your profile. Mastodon does the same, and thus verification is achieved. On my third link, that link to Amazon.com (obviously) doesn’t contain a link back to my Mastodon profile, so it doesn’t verify.

The Other Possible HTML to Verify

While CodePen is now properly putting the me value on profile URLs — that actually didn’t work for Mastodon verification on our first attempt. There were actually two problems:

  • CodePen profiles are client-side rendered, and the Mastodon crawler can only see server-side rendered HTML.
  • We needed to ensure the Mastodon crawler didn’t get trapped by the firewall.

With that second one taken care of via DevOps magic, we still needed a way to make sure the server-rendered HTML had something to verify against.

We aren’t yet server-rendering most of our React-rendered pages (we’ll get there), so the HTML that comes across that first request (and what Mastodon crawls) is essentially a shell page with minimal HTML. We could have tossed the <a rel="me" ...> links into the <body> of that first response, but that seems a little awkward to only have them ripped away by client-side rendering immediately. Instead, there is another equally valid way to provide rel="me" links, and that’s like this:

<head>
  <link rel="me" href="https://chriscoyier.net/">
  <link rel="me" href="https://front-end.social/@chriscoyier">

So we’re actually doing both the <head> links and the <a> links now, and good news, it works great.


Thanks to Will Boyd for asking about this and Amelia Bellamy-Royds for all the back-and-forth on Mastodon as we figured all this out.


Related writings:

Maximize Your Project’s Success With the Right Database Selection

Featured Imgs 23

The database management system is chosen depending on the tasks of the business. For example, startups need a quick start with minimal investment. On the other hand, banks need to store data correctly; otherwise, customers may lose their money. Today, I want to talk about how to choose a DBMS for the project, taking into account the company's needs.

Databases for a Newly Created Company

Problem: The business model of many newly launched businesses may change after entering the market. For example, Facebook was initially created as a social networking site for college students. Still, it has since expanded to become a platform for people of all ages to connect with friends, family, and businesses.

Optimizing Pgbench for CockroachDB Part 2

Featured Imgs 23

Previous Articles

I've written about pgbench before, you may find those articles below:


Motivation

I am writing a two-part article on optimizations in pgbench. Pgbench is a common benchmarking utility that comes bundled with PostgreSQL. It's ubiquitous and widely accepted as a standard tool to test database performance. Up until version 15 of pgbench, I was unable to improve performance with CockraochDB and pgbench. With this version, we now have the ability to retry transactions and it improves the performance posture for CockroachDB. However, this is not the only way to address performance issues. Today, I am going to expand on the options available to us and move the performance needle further.

An Overview of Data Engineering for Product Experimentation

Featured Imgs 23

Data engineering is a broad field and is often used as a catch-all term to signify a variety of different works. Anything that involves ingestion, storage, processing, or serving of data can constitute data engineering, and the nature of work also varies meaningfully based on the domain of the data. In this article, we focus specifically on data engineering for supporting product experimentation which is rapidly developing to be a necessary core competency for all organizations that aim to be data-driven.

Simply put, experimentation data engineering is the process of designing, building, and maintaining systems and infrastructure for collecting, storing, and analyzing data from experiments.

Treating Devs Like Human Beings

Featured Imgs 23

Sometimes among all the sprints, the pressure to ship faster, tools to measure lines of code written, it seems like we as an industry forget a simple fact: developers are knowledge workers, not robots.

To remind us what it means to be a human, we invited some of the most empathetic engineering leaders we know to Interact and asked them to sit on a panel together. The conversation that followed is one of the most insightful and relevant conversations we've heard all year. Whether you are an IC, manager, or manager of managers, we promise this conversation will help you become a more empathetic leader and colleague.Dev interrupted on DZone image

CyberTech NYC 2022: Securing the Future Together

Featured Imgs 23

The Javits Center in NYC opened its doors to hundreds of security experts from all around the world on November 15th and 16th, 2022. Over those two info-packed days, attendees participated in panels and presentations and shared their knowledge about enterprise security. Here are just some of the highlights from CyberTech NYC 2022

The Larger the Organization, the More Turtles to Corral

Early in the conference, CyberTech Co-Founder Amir Rapaport shared a very good analogy for how large enterprises have transformed, corralling turtles.

Turtles move slowly, akin to how fast we adopt new tech or modify existing systems. If you only have a few turtles, keeping up with them and making sure they are safe is pretty straightforward. But when you add more and more turtles, it becomes increasingly difficult to manage them. When you get to hundreds or thousands of turtles, or IT services, manually chasing them and keeping them safe becomes overwhelming.

Unfortunately, there is no silver bullet to this problem of herding turtles; it just takes staying vigilant and aware of newly emerging threats. This introductory session set the tone of the event, and his message of staying on top of new trends was echoed throughout the rest of CyberTech.

Daily Standup Meeting: Ways To Keep It Short and Effective

Featured Imgs 23

Developer teams are no strangers to daily standup meetings. Their success in increasing collaboration and visibility has led to their adoption in different types of teams and projects. Every day the whole team has a standup agenda meeting where developers and other team members proactively align with the project and delivery goals, share progress with the team, and be on top of blockers.

There are, however, developers who despise standup meetings because they are hyper-vigilant about even the most subtle indicators of unproductivity. They dislike regular standup meetings because they see no advantage to their work. Instead, they think that the daily meeting has little use to their skills and productivity, and they choose to work on projects rather than attend meetings.

ANEW Can Help With Road Safety

Featured Imgs 23

Prelude

Self-driving cars can change everything in terms of road safety and mobility. Self-driving vehicles are capable of sensing their immediate environment and can move safely with little or no human input. With self-driving cars, real-time alerting systems act as a communication between vehicle and driver. Real-time signaling and alerting have many tangible and intangible benefits. 

XYZ’s “Autopilot and Full Self-driving capability” has been getting better every year since its introduction. XYZ's patent to “Automate Turn Signals” is an advanced step in enhancing road safety, not only for self-driving cars but also for drivers who ignore or forget to use turn signals. There is always a question, how independent should a vehicle be in making smart decisions? Self-driving cars should be just as intelligent as the driver in making the right decisions.  

Which social network when?

Featured Imgs 20

When is it appropriate to use which social network to promote your business in your feed? I am active on Facebook, Twitter, and LinkedIn. If I have something to share about my business, do I cross-post on all three? Is it common for social networking content managers to use the same feed for all?

Average response time jump

Featured Imgs 11

On Tuesday, November 15th, the average response time (ms) in the Crawl stats section of my Google Search Console skyrocketed. It's been slowly coming back down since, but I was wondering if something changed outside my control that may have caused this anomaly. I'm still working on getting to the bottom of it, and was just curious if anyone else has experienced the same thing around the same time?

ChatGPT to answer Question Hub

Category Image 062

As you may know, Google Question Hub lets you type in keywords or topics you wish to write about on your site, and you're presented with a list of questions that Google wants to encourage you to write about. For example, I typed in PHP and was presented with questions such as:

  • What is shell script in PHP?
  • Where to test PHP code?
  • How to make PHP work?

I assume that these are search queries that a non-negligible number of people searched for on Google, and Google detected the content that exists out there for them to be sub-par. Therefore, they want to encourage high quality writers to provide better content so they can provide better results for their searchers.

As of January 5th of this upcoming year (just a few short weeks away), Question Hub will end and instead be migrated into Google Search Console as an experimental feature named "Content ideas". It's yet to be determined if this is going to happen for all search console users, or just certain ones (perhaps ones who have consistently demonstrated a history of high quality content on their site?)

Either way, it got me thinking with the recent popularity of ChatGPT. Imagine just how easy it would be to plop each of these Google-sourced questions straight into the popular A.I. content creator. If there's no existing quality content answering these questions already that Google could find, imagine ChatGPT taking a go of it. It's probably one of the reasons that Google is announcing all ChatGPT content is against their search quality guidelines.