bsky-app/bskyweb/README.embed.md
bnewbold 58842d03a9
rebased embedr (#3511)
* skeleton of embedr service, based on bskyweb

* embedr container setup

* builds on this branch

* actual routes

* fix embedr go:embed

* tweak embedr dockerfile

* progress on embedr

* fix path params

* tweaks to build process

* try to get embedr dockerfile to install embed deps

* build this branch

* updates to match sam's output HTML

* try to unbreak embedr dockerfile

* small embedr tweak

* docker hack

* get embed.js copied over to embedr

* don't x-frame-options for embed.bsky.app

* bskyembed: remove a console.log

* use html/template for golang snippet generation

* simplify embedr API fetches

* missing file

* Rm console.log fully

---------

Co-authored-by: Dan Abramov <dan.abramov@gmail.com>
2024-04-13 12:20:06 -07:00

1.9 KiB

oEmbed

https://oembed.com/

  • URL scheme: https://bsky.app/profile/*/post/*
  • API endpoint: https://embed.bsky.app/oembed

Request params:

  • url (required): support both AT-URI and bsky.app URL
  • maxwidth (optional): [220..550], 325 is default
  • maxheight (not supported!)
  • format (optional): only json supported

Response format:

  • type (required): "rich"
  • version (required): "1.0"
  • author_name (optional): display name
  • author_url (optional): profile URL
  • provider_name (optional): "Bluesky Social"
  • provider_url (optional): "https://bsky.app"
  • cache_age (optional, integer seconds): 86400 (24 hours) (?)
  • width (required): ?
  • height (required): ?

Not used:

  • title (optional): A text title, describing the resource.
  • thumbnail_url (optional): A URL to a thumbnail image representing the resource. The thumbnail must respect any maxwidth and maxheight parameters. If this parameter is present, thumbnail_width and thumbnail_height must also be present.
  • thumbnail_width (optional): The width of the optional thumbnail. If this parameter is present, thumbnail_url and thumbnail_height must also be present.
  • thumbnail_height (optional): The height of the optional thumbnail. If this parameter is present, thumbnail_url and thumbnail_width must also be present.

Only json is supported; xml is a 501.

<link rel="alternate" type="application/json+oembed" href="https://embed.bsky.app/oembed?format=json&url=https://bsky.app/profile/bnewbold.net/post/abc123" />

iframe URL

https://embed.bsky.app/embed/<did>/app.bsky.feed.post/<rkey> https://embed.bsky.app/static/embed.js

<blockquote class="bluesky-post" data-lang="en" data-align="center">
  <p lang="en" dir="ltr">{{ post-text }}</p>
  &mdash; US Department of the Interior (@Interior) <a href="https://twitter.com/Interior/status/463440424141459456?ref_src=twsrc%5Etfw">May 5, 2014</a>
</blockquote>