1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-04-27 05:18:28 -04:00

new Twitter oEmbed endpoint (shortcode input changes from tweet ID to full URL)

https://developer.twitter.com/en/docs/tweets/post-and-engage/api-reference/get-statuses-oembed

some hacking is required to continue passing only the tweet ID to <amp-twitter data-tweetid="..."> at the same time. ugh.

https://amp.dev/documentation/components/amp-twitter/#attributes
This commit is contained in:
Jake Jarvis 2020-06-28 11:29:35 -04:00
parent 3bfa8a52cc
commit 99d13da0c7
Signed by: jake
GPG Key ID: 2B0C9CF251E69A39
7 changed files with 15 additions and 14 deletions

View File

@ -24,7 +24,7 @@ A [recent post on Hacker News](https://news.ycombinator.com/item?id=19828317) po
In other words, Archive.is's nameservers throw a hissy fit and return a bogus IP when Cloudflare **doesn't** leak your geolocation info to them via the optional [EDNS client subnet feature](https://tools.ietf.org/html/rfc7871). The owner of Archive.is has plainly admitted this with [a questionable claim](https://twitter.com/archiveis/status/1018691421182791680) (in my opinion) about the lack of EDNS information causing him "so many troubles."
{{< tweet 1018691421182791680 >}}
{{< tweet "https://twitter.com/archiveis/status/1018691421182791680" >}}
He's even gone as far as [replying to support requests](https://community.cloudflare.com/t/archive-is-error-1001/18227/7) by telling people to switch to Google's DNS, which — surprise! — offers your location to nameservers [with pleasure](https://developers.google.com/speed/public-dns/docs/ecs).

View File

@ -24,7 +24,7 @@ Decisions made by the top folks at Dropbox gave me an increasingly sour taste in
- Adding a [3-device limit](https://help.dropbox.com/account/computer-limit) for free accounts, triggering another hostage negotiation resulting in me upgrading to Pro.
- Continuously forcing [bloated updates](https://www.theverge.com/2019/6/11/18661673/new-dropbox-desktop-app-google-docs-slack-atlassian) to their once-simple macOS app down users' throats, to the point where ["the new Dropbox"](https://blog.dropbox.com/topics/product-tips/new-dropbox) was consistently eating up _over a gigabyte of RAM_ and a non-negligible chunk of CPU usage thanks to an entire web browser being embedded into it:
{{< tweet 1138686582859239425 >}}
{{< tweet "https://twitter.com/sandofsky/status/1138686582859239425" >}}
- Explicitly [dropping support for symlinking](https://news.ycombinator.com/item?id=20844363) (aka making aliases to) files outside of the literal `~/Dropbox` folder, which was incredibly helpful for nerds — once their main audience and biggest cheerleaders — with things like [dotfiles](https://github.com/jakejarvis/dotfiles) and Git repositories.
- ...and as a bonus, making the process of canceling Dropbox Pro incredibly convoluted, annoying, and sketchy. Here's a video demonstration via [Justin Dunham](https://twitter.com/jwyattd):

View File

@ -19,7 +19,7 @@ In the midst of this year's long-overdue support of the [**Black Lives Matter**]
When somebody pointed out the negative connotations of Git projects being created with a branch named `master` by default, and the possibility of this making minorities feel even more unwelcome in an industry already [lacking diversity](https://www.informationisbeautiful.net/visualizations/diversity-in-tech/), GitHub CEO [Nat Friedman](https://github.com/nat) quietly [announced a plan](https://twitter.com/natfriedman/status/1271253144442253312) to change this on Twitter:
{{< tweet 1271253144442253312 >}}
{{< tweet "https://twitter.com/natfriedman/status/1271253144442253312" >}}
I think many people misunderstood this tweet to mean GitHub will forcefully rename the `master` branch of all existing projects, which would break _millions_ of programmers' workflows. If anything, it's more likely a name such as `main` will replace `master` as **the default when creating a new repository**, but that change hasn't been made yet. [GitLab is also discussing](https://gitlab.com/gitlab-org/gitlab/-/issues/222204) a similar switch to `main` as the default name. (Ideally, these changes would be made in tandem with the actual Git codebase, too. [But this doesn't seem likely.](https://lore.kernel.org/git/CAOAHyQwyXC1Z3v7BZAC+Bq6JBaM7FvBenA-1fcqeDV==apdWDg@mail.gmail.com/t/))

View File

@ -17,7 +17,7 @@ draft: false
Last month, the founder of [a small startup](https://raisup.com/) got quite a bit of [attention on Twitter](https://twitter.com/w3Nicolas/status/1134529316904153089) (and [Hacker News](https://news.ycombinator.com/item?id=20064169)) when he called out [DigitalOcean](https://www.digitalocean.com/) who, in his words, "killed" his company. Long story short: DigitalOcean's automated abuse system flagged the startup's account after they spun up about ten powerful droplets for some CPU-intensive jobs and deleted them shortly after — which is literally **the biggest selling point** of a "servers by the hour" company like DigitalOcean, by the way — and, after replying to the support ticket, an unsympathetic customer support agent [declined to reactivate](https://twitter.com/w3Nicolas/status/1134529372172509184) the account without explanation. [Nicolas](https://twitter.com/w3Nicolas) had no way of even accessing his data, turning the inconvenient but trivial task of migrating servers into a potentially fatal situation for his company.
{{< tweet 1134529316904153089 >}}
{{< tweet "https://twitter.com/w3Nicolas/status/1134529316904153089" >}}
Predictably, there were [a](https://twitter.com/kolaente/status/1134897543643615238) [lot](https://twitter.com/hwkfr/status/1135164281731911681) [of](https://twitter.com/joestarstuff/status/1135406188114276352) [Monday](https://twitter.com/FearbySoftware/status/1134717875351052288)-[morning](https://twitter.com/mkozak/status/1134557954785587200) [quarterbacks](https://twitter.com/MichMich/status/1134547174447026181) who weighed in, scolding him for not having backups ([he did](https://twitter.com/w3Nicolas/status/1134529374676500482), but they were also stored on DigitalOcean) and not paying a boatload of non-existent money for expensive load balancers pointing to multiple cloud providers. Hindsight is always 20/20, of course, but if we're talking about a small side project that exploded into a full-fledged startup with Fortune 500 clients seemingly overnight, I _completely_ understand Nicolas' thought process. _"Let's just take advantage of cloud computing's #1 selling point: press a few buttons to make our servers [harder, better, faster, stronger](https://www.youtube.com/watch?v=x84m3YyO2oU) and get back to coding!"_

View File

@ -1,8 +1,9 @@
<p class="center">
<amp-twitter
<amp-twitter
width="375"
height="472"
layout="responsive"
data-tweetid="{{ index .Params 0 }}">
</amp-twitter>
</p>
data-tweetid="{{ index (last 1 (split (index .Params 0) "/")) 0 }}"
data-lang="en"
data-align="center"
data-dnt="true">
</amp-twitter>

View File

@ -1,4 +1,4 @@
{{- $url := printf "https://api.twitter.com/1/statuses/oembed.json?id=%v&dnt=1&omit_script=1&align=center" (index .Params 0) -}}
{{- $url := printf "https://publish.twitter.com/oembed?lang=en&omit_script=true&dnt=true&align=center&url=%s" (index .Params 0 | safeURL) -}}
{{- $json := getJSON $url -}}
<div class="embed tweet">

View File

@ -14,7 +14,7 @@
"url": "git+https://github.com/jakejarvis/jarv.is.git"
},
"scripts": {
"clean": "rimraf public/ resources/ builds/ _vendor/ && hugo mod clean",
"clean": "hugo mod clean && rimraf public/ resources/ builds/ _vendor/ $TMPDIR/hugo_cache/ || true",
"build": "run-s hugo:vendor hugo minify",
"build:preview": "run-s hugo:vendor hugo:preview",
"hugo": "hugo --gc --cleanDestinationDir --verbose",