This is an alternative site for discovering Elm packages. You may be looking for the official Elm package site instead.
a small library for extracting social media references from text
version 1.0.0
license BSD3
native-modules False
elm-version 0.16.0 <= v < 0.17.0
Tag 1.0.0
Committed At 2016-04-17 20:33:14 UTC
elm-lang/core 3.0.0 <= v < 4.0.0 3.0.0

Modules

README

elm-media Build Status

elm-media is a small Elm library for extracting social media URLs from text. The typical use-case for this library is to embed videos and images from around the web into webpages.

Demo | Docs

Example

import Media
import Media.Site as Site

text = """https://imgur.com/cjCGCNH
https://youtu.be/oYk8CKH7OhE
https://www.youtube.com/watch?v=DfLvDFxcAIA
"""

{- This will extract media references in "text" for all supported sites, and
   generate URLs for each reference.
-}
results =
  text
    |> Media.find Site.all
    |> Media.urls

Supported sites

Future sites

  • Reddit
  • Twitter
  • Github
  • Gist
  • Instagram
  • Facebook
  • Google+
  • Vine
  • Vimeo
  • Steam

TODO

  • Linking to videos at specific times
  • Supporting embeds that require script tags
  • oEmbed URLs

Development

Want to add a new site? No problem! Just fork this repo and create a pull-request. Once you have a copy on your local machine:

cd elm-media
npm install
npm start