commit 7a6e74691f081e3e433e06adfe877050f2b37993 Author: Fabien Benetou Date: Sun Oct 23 23:06:33 2022 +0200 Update 'Home' diff --git a/Home.md b/Home.md new file mode 100644 index 0000000..0e6e852 --- /dev/null +++ b/Home.md @@ -0,0 +1,19 @@ +Using this as a Gist equivalent. + +```javascript +fetch('https://video.benetou.fr/api/v1/videos?count=100') +.then(function(response) { + return response.json() +}).then(function(data) { + console.log(data.data) + data.data.map( v => { + fetch('https://video.benetou.fr/api/v1/videos/'+v.id) + .then(function(response) { + if (response.status == 200) { return response.json() } + else return null + }).then(function(data) { + if (data && data.tags && data.tags.length > 0) console.log(data.name, data.id, data.tags) + }) + }) +}) +``` \ No newline at end of file