# @joegesualdo/youtube-video-scraper-node

> Get information from the html of a youtube video page.

Latest version **0.0.3** (published 2016-08-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install @joegesualdo/youtube-video-scraper-node
pnpm add @joegesualdo/youtube-video-scraper-node
yarn add @joegesualdo/youtube-video-scraper-node
bun add @joegesualdo/youtube-video-scraper-node
```

## 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.3 |
| Published | 2016-08-26 |
| First published | 2016-08-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Joe Gesualdo |
| Maintainers | joegesualdo |
| Keywords | youtube, scraper, video |

## Links

- npm: https://www.npmjs.com/package/@joegesualdo/youtube-video-scraper-node
- Repository: https://github.com/joegesualdo/youtube-video-scraper-node
- Homepage: https://github.com/joegesualdo/youtube-video-scraper-node#readme
- Issues: https://github.com/joegesualdo/youtube-video-scraper-node/issues
- npm.io page: https://npm.io/package/@joegesualdo/youtube-video-scraper-node

## Dependencies (2)

- [x-ray](https://npm.io/package/x-ray.md) ^2.3.0
- [@joegesualdo/get-meta-information-from-html](https://npm.io/package/@joegesualdo/get-meta-information-from-html.md) 0.0.1

## Alternatives

- [@tsparticles/shape-image](https://npm.io/package/@tsparticles/shape-image.md) — 303.7K weekly downloads
- [@tsparticles/shape-line](https://npm.io/package/@tsparticles/shape-line.md) — 233.7K weekly downloads
- [stringify-attributes](https://npm.io/package/stringify-attributes.md) — 58.6K weekly downloads
- [mobile-drag-drop](https://npm.io/package/mobile-drag-drop.md) — 46.3K weekly downloads
- [@comunica/actor-rdf-parse-html](https://npm.io/package/@comunica/actor-rdf-parse-html.md) — 29.2K weekly downloads

## Recent versions

- 0.0.3 (latest) — 2016-08-26
- 0.0.2 — 2016-08-26
- 0.0.1 — 2016-08-26

## README

## @joegesualdo/youtube-video-scraper-node [![Build Status](https://travis-ci.org/joegesualdo/youtube-video-scraper-node.svg?branch=master)](https://travis-ci.org/joegesualdo/youtube-video-scraper-node)
> Get information from the html of a youtube video page.

## Install
```
$ npm install --save @joegesualdo/youtube-video-scraper-node 
```

## Usage
```javascript
import YoutubeVideoScraper from "@joegesualdo/youtube-video-scraper-node"

let videoId = 'D_U6luQ6I90'
new YoutubeVideoScraper(videoId)
.then(scraper => {
  scraper.getMetaInformation()
  .then(meta => {
    console.log(meta)
  })
  .catch(err => {
    console.log(err)
  })
  scraper.getAuthorInfo()
  .then(author => {
    console.log(author)
  })
  scraper.getDescriptionExtras()
  .then(result => {
    console.log(result)
  })
  scraper.getViewCount()
  .then(viewCount=> {
    console.log(viewCount)
  })
})
```

## API
### `YoutubeVideoScraper(videoId)`
> Constructor: Creates a scraper instance

| Name | Type | Description |
|------|------|-------------|
| videoId | `String` | The ID of the youtube video|

Returns: `Promise`, and passes the instance of `YoutubeVideoScraper`

```javascript
import YoutubeVideoScraper from "@joegesualdo/youtube-video-scraper-node"

let videoId = 'D_U6luQ6I90'
new YoutubeVideoScraper(videoId)
.then(scraper => {
  scraper.getAuthorInfo()
  .then(meta => {
    console.log(meta)
  })
})
```
### `getMetaInformation()`
> Get the meta information of the youtube video

Returns: `Object`, that represent all the meta information.

```javascript
import YoutubeVideoScraper from "@joegesualdo/youtube-video-scraper-node"

let videoId = 'D_U6luQ6I90'
new YoutubeVideoScraper(videoId)
.then(scraper => {
  scraper.getMetaInformation()
  .then(meta => {
    console.log(meta)
  })
  .catch(err => {
    console.log(err)
  })
})
```
### `getAuthorInfo()`
> Get information about the author of the video

Returns: `Object`, with the keys `name` and `channelId`

```javascript
import YoutubeVideoScraper from "@joegesualdo/youtube-video-scraper-node"

let videoId = 'D_U6luQ6I90'
new YoutubeVideoScraper(videoId)
.then(scraper => {
  scraper.getAuthorInfo()
  .then(author=> {
    console.log(author)
  })
  .catch(err => {
    console.log(err)
  })
})
```
### `getDescriptionExtras()`
> Gets extra information

Returns: `Object`

```javascript
import YoutubeVideoScraper from "@joegesualdo/youtube-video-scraper-node"

let videoId = 'D_U6luQ6I90'
new YoutubeVideoScraper(videoId)
.then(scraper => {
  scraper.getDescriptionExtras()
  .then(result => {
    console.log(result)
  })
  .catch(err => {
    console.log(err)
  })
})
```
### `getViewCount()`
> Get the number of views.

Returns: `Number` that represent number of view a video has

```javascript
import YoutubeVideoScraper from "@joegesualdo/youtube-video-scraper-node"

let videoId = 'D_U6luQ6I90'
new YoutubeVideoScraper(videoId)
.then(scraper => {
  scraper.getViewCount()
  .then(meta => {
    console.log(meta)
  })
  .catch(err => {
    console.log(err)
  })
})
```
## Test
```
$ npm test
```
## Build
```
$ npm run build
```

## Related
- [example-package]() - Add description of the example package here.

## License
MIT © [Joe Gesualdo]()

---
_Source: https://npm.io/package/@joegesualdo/youtube-video-scraper-node · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
