Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@micmac/youtube

Package Overview
Dependencies
Maintainers
1
Versions
121
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@micmac/youtube - npm Package Compare versions

Comparing version 1.5.35 to 1.5.41

89

main.js

@@ -8,37 +8,33 @@ // fonction searchVideos retourne les 10 dernières videos de la chaine beerus

});
SearchAlexVideos = function () {
this.alexVideos = new Object();
this.lastTenVideos();
};
SearchAlexVideos.prototype = {
lastTenVideos: function () {
moment.locale('fr');
youtube.search.list({
"part": "id,snippet",
"channelId": "UCtToNyHU2Fjxuh__ypkHiIQ",
"maxResults": 10,
"order": "date",
"type": "video"
}, function (err, response) {
if (err) {
this.alexVideos = {'Error': err};
}
if (response) {
response.data.items.forEach(function (p, n) {
this.alexVideos[n] = {'urlThumbnails': p.snippet.thumbnails.high.url,
'idVideo': p.id.videoId,
'description': p.snippet.description.slice(0, 150),
'description2': p.snippet.description.slice(150),
'date': moment(p.snippet.publishedAt).format('LL'),
'title': p.snippet.title};
}.bind(this));
}
}.bind(this));
}
};
SearchThisVideo = function (_idVideo) {
this.alexVideo = new Object();
this.videoDetails(_idVideo);
};
SearchThisVideo.prototype = {
//var SearchAlexVideos = function () {
// this.alexVideos = new Object();
// this.lastTenVideos();
//};
//SearchAlexVideos.prototype = {
// lastTenVideos: function () {
// moment.locale('fr');
// youtube.search.list({
// "part": "id,snippet",
// "channelId": "UCtToNyHU2Fjxuh__ypkHiIQ",
// "maxResults": 10,
// "order": "date",
// "type": "video"
// }, function (err, response) {
// if (err) {
// this.alexVideos = {'Error': err};
// }
// if (response) {
// response.data.items.forEach(function (p, n) {
// this.alexVideos[n] = {'urlThumbnails': p.snippet.thumbnails.high.url,
// 'idVideo': p.id.videoId,
// 'description': p.snippet.description.slice(0, 150),
// 'description2': p.snippet.description.slice(150),
// 'date': moment(p.snippet.publishedAt).format('LL'),
// 'title': p.snippet.title};
// }.bind(this));
// }
// }.bind(this));
// }
//};
var SearchThisVideo = {
videoDetails: function (_idVideo) {

@@ -51,21 +47,22 @@ moment.locale('fr');

}, function (err, response) {
var alexVideo = new Object();
if (err) {
this.alexVideo = {'Error': err};
alexVideo = {'Error': err};
}
if (response) {
console.log(response);
// response.data.items.forEach(function (p, n) {
// this.alexVideos[n] = {'urlThumbnails': p.snippet.thumbnails.high.url,
// 'idVideo': p.id.videoId,
// 'description': p.snippet.description.slice(0, 150),
// 'description2': p.snippet.description.slice(150),
// 'date': moment(p.snippet.publishedAt).format('LL'),
// 'title': p.snippet.title};
// }.bind(this));
response.data.items.forEach(function (p, n) {
alexVideo[n] = {
'urlThumbnails': p.snippet.thumbnails.high.url,
'description': p.snippet.description,
'date': moment(p.snippet.publishedAt).format('LL'),
'title': p.snippet.title};
});
return alexVideo;
}
}.bind(this));
});
}
};
export {SearchAlexVideos as SearchVideos, SearchThisVideo as SearchThisVideo};
export {SearchThisVideo as SearchThisVideo};

@@ -72,0 +69,0 @@ // autres écritures possible :

{
"name": "@micmac/youtube",
"version": "1.5.35",
"version": "1.5.41",
"description": "utilisation api youtube data",

@@ -5,0 +5,0 @@ "main": "main.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc