openzim / freecodecamp

FreeCodeCamp.org scraper (to ZIM)
GNU General Public License v3.0
4 stars 2 forks source link
freecodecamp offline scraper tutorial zim

freeCodeCamp scraper

This scraper downloads selected freeCodeCamp courses and puts it in a ZIM file, a clean and user friendly format for storing content for offline usage.

CodeFactor License: GPL v3 codecov PyPI version shields.io PyPI - Python Version Docker

Architecture

This project consists of two major components:

Dependencies

Aside Node.JS and Python dependencies which are managed, other binary dependencies comes from Python zimscraperlib

Development

See CONTRIBUTING.md.

Prerequisites

Running scraper locally

You have to:

Sample commands:

cd zimui
yarn install
yarn build
cd ../scraper
hatch run fcc2zim --language eng --course "regular-expressions,basic-javascript,basic-data-structures,debugging,functional-programming,object-oriented-programming,basic-algorithm-scripting,intermediate-algorithm-scripting,javascript-algorithms-and-data-structures-projects" --name "fcc_en_javascript" --title "freeCodeCamp Javascript" --description "FCC Javascript Courses"

Running scraper with Docker

Run from official version (published on GHCR.io) ; ZIM will be available in the output sub-folder of current working directory.

docker run --rm -it -v $(pwd)/output:/output ghcr.io/openzim/freecodecamp:latest fcc2zim --language eng --course "regular-expressions,basic-javascript,basic-data-structures,debugging,functional-programming,object-oriented-programming,basic-algorithm-scripting,intermediate-algorithm-scripting,javascript-algorithms-and-data-structures-projects" --name "fcc_en_javascript" --title "freeCodeCamp Javascript" --description "FCC Javascript Courses"

Course Options and Limitations

Currently this scraper only supports Javascript challenges. A list of courses is passed to the scraper as a comma seperated list of 'course slugs'.

You can find a list of course slugs in the freeCodeCamp curriculum folder

In docker example above, see the --course argument : regular-expressions,basic-javascript,basic-data-structures,debugging,functional-programming,object-oriented-programming,basic-algorithm-scripting,intermediate-algorithm-scripting,javascript-algorithms-and-data-structures-projects