Socket
Book a DemoInstallSign in
Socket

youtuber

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

youtuber

Find closest matches to search query based on Levenshtein distance

2.0.1
latest
Source
npmnpm
Version published
Weekly downloads
3
200%
Maintainers
1
Weekly downloads
 
Created
Source

YouTuber

Search Youtube for songs based on title and artist. Get the best match based on Levenshtein distances.

Usage

npm i -S youtuber

The module exports a default curried function that takes 3 arguments namely: api_key string, the callback function and a track object with at least two keys (title and artist). The callback function is passed two arguments namely: err (if any or null) and the youtubed track (if successful or the track as is). The youtubed track has two new keys namely the youtube_link and the youtube_images object.

import youtuber from 'youtuber';

const client = youtuber('YOUR_API_KEY');

const random_track = {
 title: "R U Mine?",
 artist: "Arctic Monkeys"
};

const log = (err, track) => {
 if (err) {
  console.error(err);
 }
 else console.log(track);
};

client(log, random_track);

// { title: 'R U Mine?',
//   artist: 'Arctic Monkeys',
//   youtube_images:
//    { default:
//       { url: 'https://i.ytimg.com/vi/ngzC_8zqInk/default.jpg',
//         width: 120,
//         height: 90 },
//      medium:
//       { url: 'https://i.ytimg.com/vi/ngzC_8zqInk/mqdefault.jpg',
//         width: 320,
//         height: 180 },
//      high:
//       { url: 'https://i.ytimg.com/vi/ngzC_8zqInk/hqdefault.jpg',
//         width: 480,
//         height: 360 } },
//   youtube_link: 'https://www.youtube.com/watch?v=ngzC_8zqInk'
// }

Do listen to the song https://www.youtube.com/watch?v=ngzC_8zqInk

Develop

git clone https://github.com/sidjain26/youtuber/
cd youtuber
npm i
npm run build
npm run test 

Keywords

youtube

FAQs

Package last updated on 06 Jul 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.