Current section
Files
Jump to
Current section
Files
doc/readme.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="generator" content="ExDoc v0.16.2">
<title>Furlex – Furlex v0.2.1</title>
<link rel="stylesheet" href="dist/app-268c9dc719.css" />
<link rel="canonical" href="https://hexdocs.pm/furlex/readme.html" />
<script src="dist/sidebar_items-2c7d3c2064.js"></script>
</head>
<body data-type="extras">
<script>try { if(localStorage.getItem('night-mode')) document.body.className += ' night-mode'; } catch (e) { }</script>
<div class="main">
<button class="sidebar-toggle">
<span class="icon-menu" aria-hidden="true"></span>
<span class="sr-only">Toggle Sidebar</span>
</button>
<section class="sidebar">
<a href="Furlex.html" class="sidebar-projectLink">
<div class="sidebar-projectDetails">
<h1 class="sidebar-projectName">
Furlex
</h1>
<h2 class="sidebar-projectVersion">
v0.2.1
</h2>
</div>
</a>
<div class="sidebar-search">
<span class="icon-search" aria-hidden="true"></span>
<input type="text" class="sidebar-searchInput" placeholder="search" aria-label="Search" autocomplete="off" />
</div>
<ul class="sidebar-listNav">
<li><a id="extras-list" href="#full-list">Pages</a></li>
<li><a id="modules-list" href="#full-list">Modules</a></li>
</ul>
<div class="gradient"></div>
<ul id="full-list" class="sidebar-fullList"></ul>
</section>
<section class="content">
<div class="content-outer">
<div id="content" class="content-inner">
<h1>Furlex</h1>
<p>Furlex is a <a href="https://moz.com/learn/seo/schema-structured-data">structured data</a> extraction tool written in Elixir.</p>
<p>It currently supports unfurling oEmbed, Twitter Card, Facebook Open Graph, JSON-LD
and plain ole’ HTML <code class="inline"><meta /></code> data out of any url you supply.</p>
<h2 id="installation" class="section-heading">
<a href="#installation" class="hover-link"><span class="icon-link" aria-hidden="true"></span></a>
Installation
</h2>
<p>Add <code class="inline">:furlex</code> to your list of dependencies in <code class="inline">mix.exs</code>:</p>
<pre><code class="elixir">def deps do
[{:furlex, "~> 0.2.1"}]
end</code></pre>
<p>Then run <code class="inline">$ mix deps.get</code>. Also add <code class="inline">:furlex</code> to your applications list:</p>
<pre><code class="elixir">def application do
[applications: [:furlex]]
end</code></pre>
<h2 id="usage" class="section-heading">
<a href="#usage" class="hover-link"><span class="icon-link" aria-hidden="true"></span></a>
Usage
</h2>
<p>To unfurl a url, simply pass a url to <a href="Furlex.html#unfurl/1"><code class="inline">Furlex.unfurl/1</code></a></p>
<pre><code class="elixir">iex(1)> Furlex.unfurl "https://www.youtube.com/watch?v=Gh6H7Md_L2k"
{:ok,
%Furlex{canonical_url: "https://www.youtube.com/watch?v=Gh6H7Md_L2k",
facebook: %{"fb:app_id" => "87741124305",
"og:description" => "Watch the full episode: https://www.thisoldhouse.com/watch/ask-toh-future-house-offerman Ask This Old House host Kevin O’Connor visits Nick Offerman in Los A...",
"og:image" => "https://i.ytimg.com/vi/Gh6H7Md_L2k/maxresdefault.jpg",
"og:site_name" => "YouTube",
"og:title" => "Touring Nick Offerman’s Wood Shop", "og:type" => "video",
"og:url" => "https://www.youtube.com/watch?v=Gh6H7Md_L2k",
"og:video:height" => ["720", "720"],
"og:video:secure_url" => ["https://www.youtube.com/embed/Gh6H7Md_L2k",
"https://www.youtube.com/v/Gh6H7Md_L2k?version=3&autohide=1"],
"og:video:type" => ["text/html", "application/x-shockwave-flash"],
"og:video:url" => ["https://www.youtube.com/embed/Gh6H7Md_L2k",
"http://www.youtube.com/v/Gh6H7Md_L2k?version=3&autohide=1"],
"og:video:width" => ["1280", "1280"]},
json_ld: [%{"@context" => "http://schema.org", "@type" => "BreadcrumbList",
"itemListElement" => [%{"@type" => "ListItem",
"item" => %{"@id" => "http://www.youtube.com/user/thisoldhouse",
"name" => "This Old House"}, "position" => 1}]}],
oembed: %{"author_name" => "This Old House",
"author_url" => "https://www.youtube.com/user/thisoldhouse",
"height" => 270,
"html" => "<iframe width=\"480\" height=\"270\" src=\"https://www.youtube.com/embed/Gh6H7Md_L2k?feature=oembed\" frameborder=\"0\" allowfullscreen></iframe>",
"provider_name" => "YouTube", "provider_url" => "https://www.youtube.com/",
"thumbnail_height" => 360,
"thumbnail_url" => "https://i.ytimg.com/vi/Gh6H7Md_L2k/hqdefault.jpg",
"thumbnail_width" => 480, "title" => "Touring Nick Offerman’s Wood Shop",
"type" => "video", "version" => "1.0", "width" => 480},
other: %{"description" => "Watch the full episode: https://www.thisoldhouse.com/watch/ask-toh-future-house-offerman Ask This Old House host Kevin O’Connor visits Nick Offerman in Los A...",
"keywords" => "this old house, how-to, home improvement, Episode, TV Show, DIY, Ask This Old House, Nick Offerman, Kevin O'Connor, woodworking, wood shop",
"theme-color" => "#e62117",
"title" => "Touring Nick Offerman’s Wood Shop"},
status_code: 200,
twitter: %{"twitter:app:id:googleplay" => "com.google.android.youtube",
"twitter:app:id:ipad" => "544007664",
"twitter:app:id:iphone" => "544007664",
"twitter:app:name:googleplay" => "YouTube",
"twitter:app:name:ipad" => "YouTube",
"twitter:app:name:iphone" => "YouTube",
"twitter:app:url:googleplay" => "https://www.youtube.com/watch?v=Gh6H7Md_L2k",
"twitter:app:url:ipad" => "vnd.youtube://www.youtube.com/watch?v=Gh6H7Md_L2k&feature=applinks",
"twitter:app:url:iphone" => "vnd.youtube://www.youtube.com/watch?v=Gh6H7Md_L2k&feature=applinks",
"twitter:card" => "player",
"twitter:description" => "Watch the full episode: https://www.thisoldhouse.com/watch/ask-toh-future-house-offerman Ask This Old House host Kevin O’Connor visits Nick Offerman in Los A...",
"twitter:image" => "https://i.ytimg.com/vi/Gh6H7Md_L2k/maxresdefault.jpg",
"twitter:player" => "https://www.youtube.com/embed/Gh6H7Md_L2k",
"twitter:player:height" => "720", "twitter:player:width" => "1280",
"twitter:site" => "@youtube",
"twitter:title" => "Touring Nick Offerman’s Wood Shop",
"twitter:url" => "https://www.youtube.com/watch?v=Gh6H7Md_L2k"}}}</code></pre>
<h2 id="configuration" class="section-heading">
<a href="#configuration" class="hover-link"><span class="icon-link" aria-hidden="true"></span></a>
Configuration
</h2>
<p>Furlex accepts a few optional configuration parameters.</p>
<p>You may configure additional tags to capture under the Facebook
OpenGraph and TwitterCard parsers.</p>
<pre><code class="elixir">config :furlex, Furlex.Parser.Facebook,
tags: ~w(my:custom:facebook:tag another:custom:facebook:tag)
config :furlex, Furlex.Parser.Twitter,
tags: ~w(my:custom:twitter:tag)</code></pre>
<p>You may also configure the depth of the resulting Furlex map. The <code class="inline">:depth</code> option
takes an atom of either <code class="inline">:flat</code> (default) or <code class="inline">:deep</code>.</p>
<pre><code class="elixir">config :furlex, depth: :flat</code></pre>
<p> <code class="inline">:flat</code> depth will return values mapped directly beneath OpenGraph and TwitterCard keys, i.e.</p>
<pre><code class="elixir"> %Furlex{twitter: %{
"twitter:app:id:googleplay" => "com.google.android.youtube",
"twitter:app:id:ipad" => "544007664",
"twitter:app:id:iphone" => "544007664"
}}</code></pre>
<p><code class="inline">:deep</code> depth will return values grouped into colon-delimited map structures, i.e.</p>
<pre><code class="elixir">%Furlex{twitter: %{
"twitter" => %{
"app" => %{
"id" => %{
"googleplay" => "com.google.android.youtube",
"ipad" => "544007664",
"iphone" => "544007664"
}
}
}
}}</code></pre>
<h2 id="license" class="section-heading">
<a href="#license" class="hover-link"><span class="icon-link" aria-hidden="true"></span></a>
License
</h2>
<p>Copyright 2017 Clayton Gentry</p>
<p>Licensed under the Apache License, Version 2.0 (the “License”);
you may not use this file except in compliance with the License.
You may obtain a copy of the License at</p>
<pre><code class="elixir">http://www.apache.org/licenses/LICENSE-2.0`</code></pre>
<p>Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an “AS IS” BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.</p>
<footer class="footer">
<p>
<span class="line">
Built using
<a href="https://github.com/elixir-lang/ex_doc" title="ExDoc" rel="help" target="_blank">ExDoc</a> (v0.16.2),
</span>
<span class="line">
designed by
<a href="https://twitter.com/dignifiedquire" target="_blank" title="@dignifiedquire">Friedel Ziegelmayer</a>.
</span>
</p>
<button class="night-mode-toggle"><span class="sr-only">Switch theme</span></button>
</footer>
</div>
</div>
</section>
</div>
<script src="dist/app-4988ddd06b.js"></script>
</body>
</html>