Skip to content

andrielfn/open_graph

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenGraph

Module Version Hex Docs Total Download License Last Updated

A Elixir wrapper for the Open Graph protocol.

Installation

The package can be installed as:

Add :open_graph to your list of dependencies in mix.exs:

def deps do
  [
    {:open_graph, "~> 0.0.5"}
  ]
end

Ensure :open_graph is started before your application:

def application do
  [applications: [:open_graph]]
end

Usage

iex> OpenGraph.fetch("https://github.com")

{:ok,
 %OpenGraph{description: "GitHub is where people build software. More than 15 million...",
  image: "https://assets-cdn.github.com/images/modules/open_graph/github-octocat.png",
  site_name: "GitHub", title: "Build software better, together", type: nil,
  url: "https://github.com"}}

You can also parse raw HTML:

iex> OpenGraph.parse("<meta property=\"og:title\" content=\"Some title\">")

%OpenGraph{description: nil, image: nil, site_name: nil, title: "Some title",
 type: nil, url: nil}

Copyright and License

Copyright (c) 2016 Andriel Nuernberg

This work is free. You can redistribute it and/or modify it under the terms of the MIT License. See the LICENSE.md file for more details.

About

An Elixir wrapper for the Open Graph protocol

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages