File: spotify.rb

package info (click to toggle)
ruby-oembed 0.18.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 356 kB
  • sloc: ruby: 1,148; makefile: 3
file content (19 lines) | stat: -rw-r--r-- 665 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
module OEmbed
  class Providers
    # Provider for spotify.com
    # https://developer.spotify.com/documentation/embeds/reference/oembed
    # https://developer.spotify.com/documentation/embeds/tutorials/using-the-oembed-api
    Spotify = OEmbed::Provider.new(
      "https://open.spotify.com/oembed",
      format: :json
    )
    Spotify << "http://open.spotify.com/*"
    Spotify << "https://open.spotify.com/*"
    Spotify << "http://play.spotify.com/*"
    Spotify << "https://play.spotify.com/*"
    # https://developer.spotify.com/documentation/web-api/concepts/spotify-uris-ids
    Spotify << /^spotify\:(.*?)/

    add_official_provider(Spotify)
  end
end