# metagetta

> Library for fetching content metadata from around the web.

Latest version **0.4.1** (published 2016-05-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install metagetta
pnpm add metagetta
yarn add metagetta
bun add metagetta
```

## 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.4.1 |
| Published | 2016-05-18 |
| First published | 2015-08-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 6 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Reelcontent, Inc. |
| Maintainers | minznerjosh, scottbouloutian |
| Keywords | metadata, meta, youtube, vimeo, dailymotion, instagram, wistia, vast, iab, video, web |

## Links

- npm: https://www.npmjs.com/package/metagetta
- Repository: https://github.com/cinema6/metagetta
- Issues: https://github.com/cinema6/metagetta/issues
- npm.io page: https://npm.io/package/metagetta

## Dependencies (6)

- [lie](https://npm.io/package/lie.md) ^3.0.1
- [jsonp](https://npm.io/package/jsonp.md) ^0.2.0
- [cheerio](https://npm.io/package/cheerio.md) ^0.19.0
- [superagent](https://npm.io/package/superagent.md) ^1.3.0
- [vastacular](https://npm.io/package/vastacular.md) ^0.1.0
- [ffprobe-static](https://npm.io/package/ffprobe-static.md) ^1.1.0

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 0.4.1 (latest) — 2016-05-18
- 0.4.0 — 2016-03-30
- 0.3.0 — 2015-12-07
- 0.2.0 — 2015-12-02
- 0.1.0 — 2015-09-02
- 0.0.0 — 2015-08-26

## README

metagetta
=========

Metagetta is a library for fetching content metadata from around the web. Supported sources include:

* [YouTube](https://www.youtube.com/)
* [Vimeo](https://vimeo.com/)
* [Dailymotion](http://www.dailymotion.com/)
* [IAB VAST Tag](http://www.iab.net/guidelines/508676/digitalvideo/vsuite/vast/vast_copy)
* [Instagram Videos](https://www.instagram.com/)
* [Wistia Videos](http://wistia.com/hub)
* [JWPlayer Videos](http://www.jwplayer.com/)
* [Vzaar Videos](https://vzaar.com/)
* [Facebook Videos](https://developers.facebook.com/docs/plugins/embedded-video-player)

API
---
### metagetta(*uri*, [*options*])
*uri* should be a valid URI from any of the supported sources. For example, a YouTube URI (https://www.youtube.com/watch?v=fPDYj3IMkRI), a Vimeo URI (https://vimeo.com/135288462), a Dailymotion URI (http://www.dailymotion.com/video/x30f1ti_the-iced-beverage-rap_fun), a VAST tag (http://ad3.liverail.com/?LR_PUBLISHER_ID=1331&LR_CAMPAIGN_ID=229&LR_SCHEMA=vast2.), an Instagram URI (https://instagram.com/p/6DD1crjvG7/), a Wistia URI (https://cinema6.wistia.com/medias/9iqvphjp4u), a JWPlayer URI (https://content.jwplatform.com/previews/iGznZrKK-n5DiyUyn), or a Vzaar URI (http://vzaar.tv/5700429) *uri* can also be an ```Array``` of URIs (to batch calls.)

*options* (optional) should be an object containing configuration options.

A Promise is returned that will be fulfilled with the content's metadata.

### metagetta(*options*)
*options* should be an object containing configuration options. It can also be an ```Array``` of *options* (to batch calls.)

A Promise is returned that will be fulfilled with the content's metadata.

### metagetta.withConfig(*options*)
This method will return a **new** instance of ```metagetta()``` that is pre-configured with the specified *options*.

Options
-------
The following configuration options are valid:

* **uri**: A URI from any of the supported sources.
* **type**: The name of a source. Supported sources are ```youtube```, ```vimeo```, ```dailymotion```, ```vast```, ```instagram```, or ```wistia```.
* **id**: The ID of a piece of content. This does *not* apply to VAST videos.
* **fields**: An ```Array``` of the only response fields that should be included. This is useful as it can potentially reduce the amount of [YouTube quota units](https://developers.google.com/youtube/v3/getting-started#quota) metagetta consumes.
* **youtube.key**: A [YouTube API Key](https://developers.google.com/youtube/android/player/register#Create_API_Keys) (required to make calls against YouTube's Data API.)
* **instagram.key**: An [Instagram API Client Key](https://instagram.com/developer/) (required to make calls against Instagram's API)
* **wistia.key**: A [Wistia API Password](http://wistia.com/doc/data-api#making_requests) (required to make calls against Wistia's API)
* **jwplayer.key**: A [JWPlayer API Key](http://apidocs.jwplayer.com/authentication.html) (required to make calls against JWPlayer's API)
* **jwplayer.secret**: A [JWPlayer API Secret](http://apidocs.jwplayer.com/authentication.html) (also required to make calls against JWPlayer's API)
* **facebook.key**: A [Facebook Application](https://developers.facebook.com/) id (required to make calls against Facebook's API)
* **facebook.secret**: A [Facebook Application](https://developers.facebook.com/) secret (also required to make calls against Facebook's API)

Response
--------
The following response object will be provided no matter the source of the content:

* **type**: The source of the content
* **id**: The unique ID of the content
* **uri**: The URI for the content
* **title**: The name of the content
* **description**: A description of the content
* **duration**: The duration (in seconds) of the content
* **hd**: A ```Boolean``` indicating if the content is HD or not; for VAST, the highest-quality media file will be used
* **tags**: An ```Array``` of video tags
* **publishedTime**: A ```Date``` representing when the content was published/created
* **views**: The number of views the video has (likes in the case of Instagram)
* **thumbnails.small**: Url of a small thumbnail
* **thumbnails.large**: Url of a large thumbnail

Example
-------
```javascript
var metagetta = require('metagetta').withConfig({
  youtube: { key: 'f4938yrt83497ryf48975fh348957f4389' }
});

metagetta([
  'https://www.youtube.com/watch?v=fPDYj3IMkRI',
  'https://vimeo.com/135288462',
  'http://www.dailymotion.com/video/x30f1ti_the-iced-beverage-rap_fun',
  'http://ad3.liverail.com/?LR_PUBLISHER_ID=1331&LR_CAMPAIGN_ID=229&LR_SCHEMA=vast2',
  'https://instagram.com/p/6DD1crjvG7/'
]).then(function(videos) {
  videos.forEach(function(video) {
    console.log(video.title + ' is ' + video.duration + ' seconds!');
  });
}).catch(function(error) {
  console.error('There was a problem: ' + error);
});
```

Notes
-------
* As of now, JWPlayer metadata will not be retrievable in a browser environment

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