Code Monkey home page Code Monkey logo

embed-art's Introduction

Embed.Art

Introduction

Platform like twitter and facebook use meta tags to display preview when sharing url.

The format these meta tags support are limited. In particular they do not support SVG, not do they support ipfs:// urls.

The idea behind Embed.Art is to allow you to have an easy way to share your token on such platform without having to run your own preview generator.

How it works ?

When you navigate to https://embed.art/eip155:<chainID>/erc721:<contractAddress>/<tokenID> Embed.art backend, running on cloudflare (For now) will

  • fetch the tokenURI from the blockchain, along with the current block and contract metadata
  • It currently caches it, and the plan is to let user refresh if needed.
  • It then generate a preview if none already exist, it do so currently by calling an external service which use headless chrome. (The preview is generated without chrome needed to make any network request, this is to ensure the preview cannot fails) (To do that it will download http/ipfs metadata and image on the backend before hand and convert these in data uri) (It means the first request might timeout, especially for asset using IPFS with low quality pinning) (The preview is actually a html page that contains the image, this allow the preview to control the format, currently 824x412 without browser dictating background color, etc...)
  • That preview is then saved
  • It finally return html page that display the NFT, its title, description, image but also audio (if present). If an iframe is present, it replaces the image.

Future plan

  • support hot reload so you can watch dyanmic NFT in the page
  • test with more assets
  • support old contracts (cryptopunks, autoglyphs, etc...)

embed-art's People

Contributors

wighawag avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.