clsource
Liquor Tags - Fetch OpenGraph data and Render the output
Liquor Tags. Inspired by dev.to embed tags (liquid tags),
takes Open Graph data from URLs and generate output using pseudo EEx templates.
Useful when creating previews of websites using Open Graph data.
alias Liquor.Tags.Tag
content = """
{% github ElixirCL %}
{% embed https://ninjas.cl %}
"""
tags = [
Tag.new("github", "Github: <%= og.url %>", "https://github.com"),
Tag.new("embed", "Website: <%= og.title %>")
]
# Fetch only needs to return the HTML string
fetch = fn url -> Req.get!(url) |> then(& &1.body) end
Liquor.render(content, tags, fetch)
|> Kino.Text.new()
Popular in Libraries
I’ve been working on two packages (not on hex.pm yet) to build admin interfaces for phoenix apps:
bureaucrat - which contains a bunch ...
New
Hello there,
I would like to share a feature toggles library (AKA feature flags) I’ve been working on.
The main package is FunWithFlags...
New
Hello :wave:
Allow me to introduce you to Tz, an alternative time zone database support to Tzdata.
Why another library?
First and fore...
New
Hello everybody.
I have just released Jason - a new JSON library.
You might be wondering, why do we need a new library? The primary foc...
New
I’ve just released version 3 of Comeonin, a password hashing library.
The following small changes have been made:
changes to the NIF c...
New
Hello everybody :wave:
Recently, some of my colleagues talked about database ids and uuids and their problems, and I remembered the pain...
New
ExApi is a library that I’m developing now and hope release soon
This library will allow to:
list all apis
list all api implementation...
New
Hi, I just published version 0.23.0 of Elixirscript.
Most of the changes are around JavaScript interop now that Elixirscript uses the ...
New
For a good number of months I've been working on creating a very basic RTMP live video streaming server. Now that I have a very, very ba...
New
import Meeseeks.CSS
html = HTTPoison.get!("https://news.ycombinator.com/").body
for story <- Meeseeks.all(html, css("tr.athing")) do...
New
Other popular topics
I believe there are people here who are dealing with CSV files import on the daily basis, and since Excel is a really popular tool there ...
New
What is the idiomatic way of matching for not nil in Elixir?
E.g.,
First way:
defp halt_if_not_signed_in(conn, signed_in_account) when...
New
Hi all,
Trying to get some more clarity over utc_datetime and naive_datetime for Ecto:
https://hexdocs.pm/ecto/Ecto.Schema.html#module-...
New
I am trying to figure out how Mix knows whether the environment is test, dev, or prod -- where is this set?
Thanks.
New
As many of you may have realized by now (sorry for all the posts here) I’ve been working on a db problem where I’m trying to aggregate a ...
New
Using vs code and installed ElixirLS: support and debugger.
And I got an error popped up on start up says
Failed to run ‘elixir’ comma...
New
Hello, I have map which I want to convert it to string like this:
the map:
%{last_name: "tavakkoli", name: "shahryar"}
the string I ne...
New
Hi everyone,
One of the features added to Elixir early on to help integration with Erlang code was the idea of overridable function defi...
New
We’ve put together this wiki for Phoenix LiveView - please feel free to add any info you feel is worth including.
What is Phoenix LiveV...
New
Why is it that the mnesia database isn’t the most preferred database for use in Elixir/Phoenix?
New







