https://github.com/appunite/link_preview
Link preview elixir library
https://github.com/appunite/link_preview
elixir hex link-preview
Last synced: about 2 months ago
JSON representation
Link preview elixir library
- Host: GitHub
- URL: https://github.com/appunite/link_preview
- Owner: appunite
- License: apache-2.0
- Created: 2016-09-17T08:39:56.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2023-11-18T02:49:52.000Z (about 2 years ago)
- Last Synced: 2024-04-13T19:03:33.248Z (almost 2 years ago)
- Topics: elixir, hex, link-preview
- Language: Elixir
- Homepage: https://appunite.com
- Size: 88.9 KB
- Stars: 18
- Watchers: 20
- Forks: 17
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://travis-ci.org/appunite/link_preview)
[](https://coveralls.io/github/appunite/link_preview?branch=master)
[](https://hex.pm/packages/link_preview)
# LinkPreview
LinkPreview is a package that tries to receive meta information from given http(s) address
## Installation
1. Add link_preview to your list of dependencies in `mix.exs`:
```elixir
def deps do
[
{:link_preview, "~> 1.0"}
]
end
```
2. For Elixir < 1.4 ensure link_preview is started before your application:
```elixir
def application do
[applications: [:link_preview]]
end
```
## Example usage
You just need to execute:
```elixir
LinkPreview.create("www.yahoo.pl")
```
in response you'll receive
```elixir
{:ok, %LinkPreview.Page{
description: "News, email and search are just the beginning. Discover more every day. Find your yodel.",
images: [%{url: "https://s.yimg.com/dh/ap/default/130909/y_200_a.png"}],
original_url: "www.yahoo.pl",
title: "Yahoo",
website_url: "yahoo.com"
}}
```
## License
Copyright 2017 Tobiasz Małecki
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
http://www.apache.org/licenses/LICENSE-2.0
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.