Skip to content

Instantly share code, notes, and snippets.

@ganapativs
Last active June 20, 2016 14:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ganapativs/d81f1646afdbe574f2ef2b04088c89b1 to your computer and use it in GitHub Desktop.
Save ganapativs/d81f1646afdbe574f2ef2b04088c89b1 to your computer and use it in GitHub Desktop.
Egghead lessons downloading
* Download and install react developers tool from here - https://chrome.google.com/webstore/detail/react-developer-tools/fmkadmapgofadopljbjfkapdkoienihi?hl=en
* Open egghead lesson's page you want to download, and open console.
* Go to react(Added by react developer tools) tab in console and inspect and search by Component Name <NextUpLessonList> and select.
* Now go to console tab and run: $r.state.list.lessons.map(function(e){console.log(e.lesson_http_url)}) to get lessons list.
* Copy list and convert it to a JS array, like
["https://egghead.io/lessons/tools-intro-to-the-production-webpack-course",
"https://egghead.io/lessons/tools-validate-your-webpack-config-with-webpack-validator",
"https://egghead.io/lessons/tools-tree-shaking-with-webpack-2",
"https://egghead.io/lessons/tools-polyfill-promises-for-webpack-2",
"https://egghead.io/lessons/tools-maintain-sane-file-sizes-with-webpack-code-splitting",
"https://egghead.io/lessons/tools-hashing-with-webpack-for-long-term-caching",....].
* install egghead-downloader using npm -> npm install -g --production egghead-downloader
* Run node and execute this code and wait for the process to complete to download all lessons
<code>
var links = <Lesson links array>;
var sys = require('sys');
var exec = require('child_process').execSync;
function puts(error, stdout, stderr) { sys.puts(stdout) }
for(i =0; i< links.length; i++){exec("egghead-downloader -c "+links[i]+" -f -output-dir ./", puts);}
</code>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment