Current section
Files
Jump to
Current section
Files
doc/Furlex.Parser.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.20.2">
<meta name="project" content="Furlex v0.4.1">
<title>Furlex.Parser — Furlex v0.4.1</title>
<link rel="stylesheet" href="dist/html-d9f58a6320b5bfa6dd77.css" />
<link rel="canonical" href="https://hexdocs.pm/furlex/Furlex.Parser.html" />
<script src="dist/sidebar_items-10a007b640.js"></script>
<script src="docs_config.js"></script>
<script async src="dist/html-d9f58a6320b5bfa6dd77.js"></script>
</head>
<body data-type="modules">
<script>try { if(localStorage.getItem('night-mode')) document.body.className += ' night-mode'; } catch (e) { }</script>
<div class="main">
<button class="sidebar-button sidebar-toggle">
<span class="icon-menu" title="Collapse/expand sidebar"></span>
</button>
<section class="sidebar">
<form class="sidebar-search" action="search.html">
<button type="submit" class="search-button">
<span class="icon-search" aria-hidden="true"></span>
</button>
<button type="button" tabindex="-1" class="search-close-button">
<span class="icon-cross" title="Cancel search"></span>
</button>
<label class="search-label">
<input name="q" type="text" id="search-list" class="search-input" placeholder="Search..." aria-label="Search" autocomplete="off" />
</label>
</form>
<div class="autocomplete">
<div class="autocomplete-results">
</div>
</div>
<div class="sidebar-header">
<div class="sidebar-projectDetails">
<a href="Furlex.html" class="sidebar-projectName">
Furlex </a>
<h2 class="sidebar-projectVersion">
v0.4.1
</h2>
</div>
</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>
<small class="app-vsn">Furlex v0.4.1</small>
Furlex.Parser <small>behaviour</small>
<a href="https://github.com/claytongentry/furlex/blob/master/lib/furlex/parser.ex#L1" title="View Source" class="view-source" rel="help">
<span class="icon-code" aria-hidden="true"></span>
<span class="sr-only">View Source</span>
</a>
</h1>
<section id="summary" class="details-list">
<h1 class="section-heading">
<a class="hover-link" href="#summary">
<span class="icon-link" aria-hidden="true"></span>
<span class="sr-only">Link to this section</span>
</a>
Summary
</h1>
<div class="summary-functions summary">
<h2>
<a href="#functions">Functions</a>
</h2>
<div class="summary-row">
<div class="summary-signature">
<a href="#extract/3">extract(tags, html, match)</a>
</div>
<div class="summary-synopsis"><p>Extracts the given tags from the given raw html according to
the given match function</p></div>
</div>
<div class="summary-row">
<div class="summary-signature">
<a href="#extract_canonical/1">extract_canonical(html)</a>
</div>
<div class="summary-synopsis"><p>Extracts a canonical url from the given raw HTML</p></div>
</div>
<div class="summary-row">
<div class="summary-signature">
<a href="#group_keys/1">group_keys(map)</a>
</div>
<div class="summary-synopsis"><p>Groups colon-separated keys into dynamic map structures</p></div>
</div>
</div>
<div class="summary-callbacks summary">
<h2>
<a href="#callbacks">Callbacks</a>
</h2>
<div class="summary-row">
<div class="summary-signature">
<a href="#c:parse/1">parse(html)</a>
</div>
<div class="summary-synopsis"><p>Parses the given HTML, returning a map structure of structured
data keys mapping to their respective values, or an error.</p></div>
</div>
</div>
</section>
<section id="functions" class="details-list">
<h1 class="section-heading">
<a class="hover-link" href="#functions">
<span class="icon-link" aria-hidden="true"></span>
<span class="sr-only">Link to this section</span>
</a>
Functions </h1>
<div class="functions-list">
<section class="detail" id="extract/3">
<div class="detail-header">
<a href="#extract/3" class="detail-link" title="Link to this function">
<span class="icon-link" aria-hidden="true"></span>
<span class="sr-only">Link to this function</span>
</a>
<h1 class="signature">extract(tags, html, match)</span>
<a href="https://github.com/claytongentry/furlex/blob/master/lib/furlex/parser.ex#L14" class="view-source" rel="help" title="View Source">
<span class="icon-code" aria-hidden="true"></span>
<span class="sr-only">View Source</span>
</a>
<div class="specs">
<pre>extract(<a href="https://hexdocs.pm/elixir/List.html#t:t/0">List.t</a>() | <a href="https://hexdocs.pm/elixir/String.html#t:t/0">String.t</a>(), <a href="https://hexdocs.pm/elixir/String.html#t:t/0">String.t</a>(), <a href="https://hexdocs.pm/elixir/Function.html#t:t/0">Function.t</a>()) :: <a href="https://hexdocs.pm/elixir/Map.html#t:t/0">Map.t</a>()</pre>
</div>
</div>
<section class="docstring">
<p>Extracts the given tags from the given raw html according to
the given match function</p>
</section>
</section>
<section class="detail" id="extract_canonical/1">
<div class="detail-header">
<a href="#extract_canonical/1" class="detail-link" title="Link to this function">
<span class="icon-link" aria-hidden="true"></span>
<span class="sr-only">Link to this function</span>
</a>
<h1 class="signature">extract_canonical(html)</span>
<a href="https://github.com/claytongentry/furlex/blob/master/lib/furlex/parser.ex#L38" class="view-source" rel="help" title="View Source">
<span class="icon-code" aria-hidden="true"></span>
<span class="sr-only">View Source</span>
</a>
<div class="specs">
<pre>extract_canonical(<a href="https://hexdocs.pm/elixir/String.html#t:t/0">String.t</a>()) :: nil | <a href="https://hexdocs.pm/elixir/String.html#t:t/0">String.t</a>()</pre>
</div>
</div>
<section class="docstring">
<p>Extracts a canonical url from the given raw HTML</p>
</section>
</section>
<section class="detail" id="group_keys/1">
<div class="detail-header">
<a href="#group_keys/1" class="detail-link" title="Link to this function">
<span class="icon-link" aria-hidden="true"></span>
<span class="sr-only">Link to this function</span>
</a>
<h1 class="signature">group_keys(map)</span>
<a href="https://github.com/claytongentry/furlex/blob/master/lib/furlex/parser.ex#L69" class="view-source" rel="help" title="View Source">
<span class="icon-code" aria-hidden="true"></span>
<span class="sr-only">View Source</span>
</a>
<div class="specs">
<pre>group_keys(<a href="https://hexdocs.pm/elixir/Map.html#t:t/0">Map.t</a>()) :: <a href="https://hexdocs.pm/elixir/Map.html#t:t/0">Map.t</a>()</pre>
</div>
</div>
<section class="docstring">
<p>Groups colon-separated keys into dynamic map structures</p>
<h2 id="group_keys/1-examples" class="section-heading">
<a href="#group_keys/1-examples" class="hover-link"><span class="icon-link" aria-hidden="true"></span></a>
Examples
</h2>
<p> iex> Application.put_env(:furlex, :group_keys?, false)
iex> Furlex.Parser.group_keys %{"twitter:app:id" => 123, "twitter:app:name" => "YouTube"}
%{"twitter:app:id" => 123, "twitter:app:name" => "YouTube"}</p>
<p> iex> Application.put_env(:furlex, :group_keys?, true)
iex> Furlex.Parser.group_keys %{"twitter:app:id" => 123, "twitter:app:name" => "YouTube"}
%{</p>
<pre><code class="nohighlight makeup elixir"><span class="s">"twitter"</span><span class="w"> </span><span class="o">=</span><span class="o">></span><span class="w"> </span><span class="p" data-group-id="3212725790-1">%{</span><span class="w">
</span><span class="s">"app"</span><span class="w"> </span><span class="o">=</span><span class="o">></span><span class="w"> </span><span class="p" data-group-id="3212725790-2">%{</span><span class="w">
</span><span class="s">"id"</span><span class="w"> </span><span class="o">=</span><span class="o">></span><span class="w"> </span><span class="mi">123</span><span class="p">,</span><span class="w">
</span><span class="s">"name"</span><span class="w"> </span><span class="o">=</span><span class="o">></span><span class="w"> </span><span class="s">"YouTube"</span><span class="w">
</span><span class="p" data-group-id="3212725790-2">}</span><span class="w">
</span><span class="p" data-group-id="3212725790-1">}</span></code></pre>
<p> }</p>
</section>
</section>
</div>
</section>
<section id="callbacks" class="details-list">
<h1 class="section-heading">
<a class="hover-link" href="#callbacks">
<span class="icon-link" aria-hidden="true"></span>
<span class="sr-only">Link to this section</span>
</a>
Callbacks </h1>
<div class="callbacks-list">
<section class="detail" id="c:parse/1">
<div class="detail-header">
<a href="#c:parse/1" class="detail-link" title="Link to this callback">
<span class="icon-link" aria-hidden="true"></span>
<span class="sr-only">Link to this callback</span>
</a>
<h1 class="signature">parse(html)</span>
<a href="https://github.com/claytongentry/furlex/blob/master/lib/furlex/parser.ex#L7" class="view-source" rel="help" title="View Source">
<span class="icon-code" aria-hidden="true"></span>
<span class="sr-only">View Source</span>
</a>
<div class="specs">
<pre>parse(html :: <a href="https://hexdocs.pm/elixir/String.html#t:t/0">String.t</a>()) :: {:ok, <a href="https://hexdocs.pm/elixir/Map.html#t:t/0">Map.t</a>()} | {:error, <a href="https://hexdocs.pm/elixir/Atom.html#t:t/0">Atom.t</a>()}</pre>
</div>
</div>
<section class="docstring">
<p>Parses the given HTML, returning a map structure of structured
data keys mapping to their respective values, or an error.</p>
</section>
</section>
</div>
</section>
<footer class="footer">
<p>
<span class="line">
Built using
<a href="https://github.com/elixir-lang/ex_doc" title="ExDoc" target="_blank" rel="help noopener">ExDoc</a> (v0.20.2),
</span>
<span class="line">
designed by
<a href="https://twitter.com/dignifiedquire" target="_blank" rel="noopener" title="@dignifiedquire">Friedel Ziegelmayer</a>.
</span>
</p>
<p>
<button class="line footer-button night-mode-toggle">
Toggle night mode
</button>
<button class="line footer-button display-shortcuts-help">
Display keyboard shortcuts
</button>
</p>
</footer>
</div>
</div>
</section>
</div>
</body>
</html>