· web

Twitter for Websites

In yesterday’s post, I tried out the Hugo shortcode for embedding tweets from Twitter.

After having gone to some effort to remove external assets from my website, it’s not great that this shortcode will automatically include JavaScript from the Twitter website. The way that Twitter for Websites seems to work is that the JavaScript provides enhancement but the JavaScript is not required for the content to work. This is great, as it means that content still works when syndicated on planets or viewed in an RSS reader or through a text-only browser.

I haven’t looked at the JavaScript in detail yet, but I did see that there is an option for websites to opt-out of tracking for all users loading the JavaScript as a result of visiting that website. All you need to do is include the following <meta> tag on any page that uses the Twitter widgets.js:

<meta name="twitter:dnt" content="on">

To be safe, I’m including this on every page generated as part of my Hugo site.

In the past, Twitter used to honour the Do Not Track setting in browsers but have now replaced this with granular controls which make it more difficult to generally opt-out of tracking. While I think I trust that the twitter:dnt value will be honoured for now, I don’t believe it will be forever.

I’m thinking about writing a cut-down widgets.js that maybe isn’t as functional but could be self-hosted. This would also allow for it to be fetched via an Onion service. If this already exists, you’ve found another solution, or would like to collaborate on a solution then please let me know.


If you would like to contact me with comments, please send me an email.
If you would like to support my free software work, you can donate via PayPal.


This post was syndicated on: