syusui-s / rabbit

🐰 A nostr client like TweetDeck
https://rabbit.syusui.net
GNU Affero General Public License v3.0
66 stars 13 forks source link

Support OGP and oEmbed #61

Open syusui-s opened 9 months ago

syusui-s commented 9 months ago

Most of these APIs denies cross origin requests so it is needed to bypass it in someway.

How

I am thinking to create a browser extension to get OGP and oEmbed. Communication between rabbit and the extension can be accomplished by postMessage API.

type OGPData = {
  embeddingType: 'OGP'
  title?: string;
  siteName?: string;
  type?: string;
  url?: string;
  images?: string[];
  description?: string;
};
type EmbeddingInfo = OGPData;

async function getEmbeddingInfo(url: string): EmbeddingInfo { /* implementation */ }

This extension can support other functions like uploading images to Gyazo.