Giter VIP home page Giter VIP logo

node-youtubeapi-simplifier's Introduction

node-youtubeAPI-simplifier

The Youtube-API probably isn't the simplest api in the world. So why isn't there a simplifier? Well, don't worry, now there is one :)

I already implemented a bunch of functions regarding channels, playlists and (a basic & simple) video search.

Examples can be found in the examples directory and at the end of this readme.

Contribute

Because my time for developing isn't unlimited Pull-Requests are always welcome, just look at my implementations and make yours look the same, so we have a little bit of readability and structure.

Known Bugs

  • There shouldn't be any.

Example Usages

ChannelFunctions

Retrieving Details for an User

var ytapi = require('node-youtubeapi-simplifier');
ytapi.setup('YOUR API KEY');
ytapi.channelFunctions.getDetailsForUser('Youtube Username').then(function (data) {
	console.log('ChannelId: ' + data.channelId);
	console.log('Title: ' + data.title);
	console.log('Description: ' + data.description);
	console.log('Published at: ' + data.publishedAt);
	console.log('Avatar Urls:');
	console.log(data.avatar);
	console.log('Likes Playlist: ' + data.likesPlaylist);
	console.log('Favorites Playlist: ' + data.favoritesPlaylist);
	console.log('Uploads Playlist: ' + data.uploadsPlaylist);
});

Get the ChannelId for an User

var ytapi = require('node-youtubeapi-simplifier');
ytapi.setup('YOUR API KEY');
ytapi.channelFunctions.getChannelIdForUser('Youtube Username').then(function (data) {
	console.log('ChannelId: ' + data.channelId);
});

Get statistics for an User

var ytapi = require('node-youtubeapi-simplifier');
ytapi.setup('YOUR API KEY');
ytapi.channelFunctions.getStatisticsForUser('Youtube Username').then(function (data) {
	console.log('Views: ' + data.viewCount);
	console.log('Comments: ' + data.commentCount);
	console.log('Subscriber: ' + data.subscriberCount);
	console.log('Videos: ' + data.videoCount);
});

PlaylistFunctions

Get a list of playlists for an User

All (without Limitations - Warning: Can take long!)
var ytapi = require('node-youtubeapi-simplifier');
ytapi.setup('YOUR API KEY');
ytapi.playlistFunctions.getPlaylistsForUser('Youtube Username').then(function (data) {
	console.log(data);
});
Limited to a specified amount (in this case: 10)
var ytapi = require('node-youtubeapi-simplifier');
ytapi.setup('YOUR API KEY');
ytapi.playlistFunctions.getPlaylistsForUser('Youtube Username', 10).then(function (data) {
	console.log(data);
});

Get a list of Videos for a playlist

All (without Limitations - Warning: Can take long!)
var ytapi = require('node-youtubeapi-simplifier');
ytapi.setup('YOUR API KEY');
ytapi.playlistFunctions.getVideosForPlaylist('PlaylistID').then(function (data) {
	console.log(data);
});
Limited to a specified amount (in this case: 10)
var ytapi = require('node-youtubeapi-simplifier');
ytapi.setup('YOUR API KEY');
ytapi.playlistFunctions.getVideosForPlaylist('PlaylistID', 10).then(function (data) {
	console.log(data);
});

SearchFunctions

Simple Search (always returns first 50 Elements | might change)

var ytapi = require('node-youtubeapi-simplifier');
ytapi.setup('YOUR API KEY');
ytapi.searchFunctions.simpleSearch('Search String').then(function (data) {
	console.log(data);
});

Channel Internal Search

All (without Limitations - Warning: Can take long!)
var ytapi = require('node-youtubeapi-simplifier');
ytapi.setup('YOUR API KEY');
ytapi.searchFunctions.channelInternalSearch('Youtube Username', 'Search String').then(function (data) {
	console.log(data);
});
Limited to a specified amount (in this case: 10)
var ytapi = require('node-youtubeapi-simplifier');
ytapi.setup('YOUR API KEY');
ytapi.searchFunctions.channelInternalSearch('Youtube Username', 'Search String', 10).then(function (data) {
	console.log(data);
});

node-youtubeapi-simplifier's People

Contributors

haidy777 avatar

Watchers

Hunter.Hu avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.