https://github.com/r8/elixir-oembed
oEmbed consumer library for Elixir
https://github.com/r8/elixir-oembed
elixir elixir-lang oembed
Last synced: 7 months ago
JSON representation
oEmbed consumer library for Elixir
- Host: GitHub
- URL: https://github.com/r8/elixir-oembed
- Owner: r8
- License: mit
- Created: 2017-02-21T11:52:07.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2024-12-14T16:42:42.000Z (about 1 year ago)
- Last Synced: 2025-06-21T04:38:50.280Z (7 months ago)
- Topics: elixir, elixir-lang, oembed
- Language: Elixir
- Homepage: https://hex.pm/packages/oembed
- Size: 492 KB
- Stars: 38
- Watchers: 2
- Forks: 15
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# OEmbed
[](https://github.com/r8/elixir-oembed/actions?query=workflow%3ACI)
[](https://hex.pm/packages/oembed)
[](https://hex.pm/packages/oembed)
oEmbed consumer library for Elixir applications.
> oEmbed is a format for allowing an embedded representation of a URL on third party sites. The simple API allows a website to display embedded content (such as photos or videos) when a user posts a link to that resource, without having to parse the resource directly.
>
> -- See [oembed.com](http://oembed.com) for more info about the protocol.
This library supports any discoverable oEmbed endpoint and some other services via custom adapters.
Among them:
- YouTube
- Instagram
- Pinterest
- Vimeo
## Installation
Add `oembed` to your list of dependencies in `mix.exs`:
```elixir
def deps do
[{:oembed, "~> 0.5.0"}]
end
```
## Usage
```elixir
{:ok, result} = OEmbed.for("https://www.youtube.com/watch?v=dQw4w9WgXcQ")
```
## Custom providers
You can implement modules that support provider behaviour and add them to the provider list from your app config
```elixir
config :oembed, :providers, [MyApp.OEmbed.SomeProvider, MyApp.OEmbed.SomeOtherProvider]
```