I was debugging another issue, and at some point I got an error on build:
~/Labs/Digital-Insanity $ hugo server
Building sites … ERROR 2018/08/06 00:02:18 Failed to get json resource https://api.twitter.com/1/statuses/oembed.json?id=935405103997059073&dnt=true with error message Failed to retrieve remote file: Forbidden
ERROR 2018/08/06 00:02:18 error processing shortcode "_internal/shortcodes/tweet.html" for page "post/2017-12-13-danharmon/index.md": template: _internal/shortcodes/tweet.html:7:13: executing "_internal/shortcodes/tweet.html" at <getJSON $url>: error calling getJSON: Failed to retrieve remote file: Forbidden
Total in 11062 ms
Error: Error building site: logged 1 error(s)
I went to look at the post causing the error and … wubba lubba dub dub. Found out that Dan Harmon got bullied for past mistakes and deleted his twitter account. I worked around it, so this isn’t a pain right now. Still maybe we can make the current tweet shortcode a bit more forgiving.
I’ve always respected Twitter for giving individuals peace of mind in allowing them to remove their property from the service. Not all services allow content creators to remove content which can cause psychological harm in cases of cyberbullying. Sorry to hear that happened. Maybe an option to disable the prerender would suffice, if not already available, under abend.
I’m not a fan of caching by default. In this case the information was innocuous, but it could have been sensitive and the author wished to delete the account and all associated content. The owner of the site can and should use his/her judgement to decide if the tweet should be recovered from a previous build or not.
I can see where you are coming from but IMO once you’ve tweeted something publicly and someone has now quoted you on their site then it’s a matter of public record at that point.
I just encountered this for the first time in a while and it finally occurred to me to just render the tweet entirely in the browser by overriding Hugo’s built-in tweet shortcode: