Skip to content

Instantly share code, notes, and snippets.

@ream88
Last active January 4, 2016 11:19
Show Gist options
  • Save ream88/8614414 to your computer and use it in GitHub Desktop.
Save ream88/8614414 to your computer and use it in GitHub Desktop.
Node.js script to download the https://executeios.com videos
// npm install superagent jsdom jquery
var https = require('superagent'),
exec = require('child_process').exec
https.get('https://executeios.com/receipt/<yourid>', function(res) {
var window = require('jsdom').jsdom(res.text).createWindow()
var $ = require('jquery')(window)
var videos = []
$.each($('ol'), function(i, ol) {
$.each($(ol).find('li'), function(j, li) {
li = $(li)
videos.push({
name: "Day " + (i + 1) + " — " (j + 1) + " " + li.find('a:first').text(),
url: li.find('a:last').attr('href')
})
})
})
$.each(videos, function(i, video) {
exec("curl -L https://executeios.com" + video.url + " > \"videos/" + video.name + ".mp4\"")
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment