@micmac/youtube
Advanced tools
Comparing version 2.0.1 to 2.0.2
16
main.js
@@ -75,4 +75,5 @@ // fonction searchVideos retourne les 10 dernières videos de la chaine beerus | ||
var description = res.data.items[0].snippet.description; | ||
res.data.items[0].snippet.description = description.slice(0,200); | ||
res.data.items[0].snippet.description2 = description.slice(200); | ||
var descriptionSplit = splitTxt(description); | ||
res.data.items[0].snippet.description = descriptionSplit.chaine1; | ||
res.data.items[0].snippet.description2 = descriptionSplit.chaine2; | ||
this.params = { | ||
@@ -106,1 +107,12 @@ css: cssFile, | ||
//}; | ||
function splitTxt(_chaine) { | ||
let lgTxt = _chaine.length(); | ||
let chaine1 = _chaine.slice(0,Math.max(Math.floor(lgTxt/2),200)); | ||
let chaine2 = _chaine.slice(Math.max(Math.floor(lgTxt/2),200)); | ||
let lastSpacePos = chaine1.lastIndexOf(' '); | ||
let pieceOfChaine = chaine1.slice(lastSpacePos); | ||
chaine1 = chaine1.slice(0, lastSpacePos); | ||
chaine2 = pieceOfChaine + chaine2; | ||
return {chaine1:'',chaine2:''}; | ||
}; |
{ | ||
"name": "@micmac/youtube", | ||
"version": "2.0.1", | ||
"version": "2.0.2", | ||
"description": "utilisation api youtube data", | ||
@@ -5,0 +5,0 @@ "main": "main.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4427
111