# embed-url

> Extract and embed content from third party providers

Latest version **0.0.6** (published 2017-07-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install embed-url
pnpm add embed-url
yarn add embed-url
bun add embed-url
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.6 |
| Published | 2017-07-24 |
| First published | 2017-07-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=4.3.2 |
| Dependencies | 8 |
| Known vulnerabilities | 0 (+2 in 2 direct dependencies) |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Galonde Matthieu |
| Maintainers | tekdreams |
| Keywords | embed, embed-url, url, providers, extractUrl, extract-url, embedUrl, thirdParty, media, provider |

## Links

- npm: https://www.npmjs.com/package/embed-url
- Repository: https://github.com/tekdreams/embed-url
- Homepage: https://github.com/tekdreams/embed-url#readme
- Issues: https://github.com/tekdreams/embed-url/issues
- npm.io page: https://npm.io/package/embed-url

## Dependencies (8)

- [mocha](https://npm.io/package/mocha.md) 3.4.1
- [string](https://npm.io/package/string.md) ~3.3.3
- [n-vimeo](https://npm.io/package/n-vimeo.md) 0.3.0
- [request](https://npm.io/package/request.md) ~2.81.0
- [winston](https://npm.io/package/winston.md) ~2.3.1
- [pinterest-api](https://npm.io/package/pinterest-api.md) 1.1.4
- [flickr-with-uploads](https://npm.io/package/flickr-with-uploads.md) 2.0.4
- [instagram-private-api](https://npm.io/package/instagram-private-api.md) 0.5.16

## Alternatives

- [base64url](https://npm.io/package/base64url.md) — 6.1M weekly downloads
- [get-installed-path](https://npm.io/package/get-installed-path.md) — 502.9K weekly downloads
- [@uppy/url](https://npm.io/package/@uppy/url.md) — 185.8K weekly downloads
- [@d3fc/d3fc-shape](https://npm.io/package/@d3fc/d3fc-shape.md) — 16.2K weekly downloads
- [localizer](https://npm.io/package/localizer.md) — 226 weekly downloads

## Recent versions

- 0.0.6 (latest) — 2017-07-24
- 0.0.5 — 2017-07-24
- 0.0.3 — 2017-07-11
- 0.0.2 — 2017-07-11
- 0.0.1 — 2017-07-11

## README

[![Build Status](https://travis-ci.org/tekdreams/embed-url.svg?branch=master)](https://travis-ci.org/tekdreams/embed-url)

Embed Url 
=========

A small library that allows to embed and extract content from third party providers url.
This module manage:
- Dailymotion video urls
- Flickr photo urls
- Instagram post urls
- Pinterest board and pin urls
- Tumblr post urls
- Twitter urls (Tweets)
- Vimeo video urls
- Youtube video urls

## Prerequisites

Node.js - Version >=4.3.2

## Installation

Use npm:

```
$ npm install embed-url --save
```
Or you can clone and install HEAD:

```
git clone https://github.com/tekdreams/embed-url.git
cd embed-url
npm install
```


## Getting Started

For some providers, credentials configurations are mandatory. To start using the embed-url module with Flickr, Instagram, Tumblr, Twitter, Youtube Urls, don't forget to update the credentials concerned in the "provider-config/credentialsConfig.js" file. 

How to get the credentials:

- Instagram: https://www.instagram.com/developer/

- Flickr: https://www.flickr.com/services/api/misc.api_keys.html

- Tumblr: https://www.tumblr.com/docs/en/api/v2

- Twitter: https://apps.twitter.com/

- Youtube: https://developers.google.com/youtube/v3/getting-started

This module utilizes ES6 Promises to handle the API calls.

## Usage

```
const embedurl = require('embed-url');

```

To extract datas from a single url use the following...

```
embedurl.url(URL_TO_EXTRACT)
    .then(result => {
    	// do stuff
    	console.log("Embed url", result)
    })
    .catch(error => {
    	// errors will bubble up through the reject method of the promise.
        // you'll want to console.log them otherwise it'll fail silently
        console.log("Error", error)
    })
```

The `result` returned in from the promise will be a `Result` object.


## Returned Data

The API returns an object. Below is an example 

```
{ mediaId: '1552321983961937074_25998477',
  title: 'Sem Photoshop, é rosa mesmo! 😉👍🏼 #lascoloradas #yucatán #mexico #roadtrip',
  embedUrl: 'https://scontent-cdg2-1.cdninstagram.com/t51.2885-15/e35/19624133_1476073882469010_4796107352862359552_n.jpg?ig_cache_key=MTU1MjMyMTk4Mzk2MTkzNzA3NA%3D%3D.2&se=8',
  thumbnail: 'https://scontent-cdg2-1.cdninstagram.com/t51.2885-15/e35/19624133_1476073882469010_4796107352862359552_n.jpg?ig_cache_key=MTU1MjMyMTk4Mzk2MTkzNzA3NA%3D%3D.2&se=8',
  provider: 'instagram',
  url: 'https://www.instagram.com/p/BWK9J6vFLSy/?tagged=lascoloradas',
  typeMedia: 'photo',
  instagram:  {
  //Here the original object returned from the provider API if you need more data than the ones above
  }
}
```

## Tests

  `npm test`

Some tests will return "ERROR" due to missing api key

## Contributing

In lieu of a formal style guide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code.

## License

Copyright © 2017 Tekdreams. [MIT Licensed](LICENSE).

---
_Source: https://npm.io/package/embed-url · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
