Git Product home page Git Product logo

xkcd-scraper's Introduction

XKCD Scraper

Let's download all the XKCD comics and their titles! Why not use a browser plugin? Because you are a geek (or just want to look cool among your friends ๐Ÿ˜†)!!!

NOTICE

I'm not using this project anymore so some things might be broken from time to time but please file an issue and we can work together to make it work again and resolve the issues.

Setup Instructions

Why are you even reading this (unless you are somebody new to Python)???

# Clone the repository
git clone https://github.com/hashhar/xkcd-scraper.git
# Install dependencies
pip3 install -r requirements.txt
# Run the program
python3 xkcd-scraper.py --your-arguments

You can also install this within a Python virtual environment like so:

# Create a virtual env
python3 -m venv venv
# Activate the virtual env
source venv/bin/activate
# Install dependencies within the virtual env
pip3 install -r requirements.txt
# Run the program
python3 xkcd-scraper.py --your-arguments

Command Line Options

Unfortunately, you will need to provide command line parameters everytime you run the script (because I am a bad, bad man ๐Ÿ˜ˆ)

  • -o directory, --output-dir directory
    Changes the output directory to directory.
    The default output directory is the current working directory.

  • N
    This will fetch the comic number N from xkcd where N is an integer or a set of integers greater than or equal to 0.
    Use 0 to fetch the latest comic.

  • -r M N, --range M N
    Fetches comics within the range M to N.
    -r 3 30, --range 3 30 will fetch the comics from 3 to 30.

  • -a, --all
    Fetches all the comics from the first one to the latest.

  • -x N, --random N
    Fetches N pseudo-random (because, well, the world is not fair) comics. You can specify how many you want to fetch as -x 10, --random 30. This will fetch 30 random comics.

  • -t, --title
    Appends the title of the comic to the filename of the downloaded comic

Comments

I am still working on it so feel free to contribute code and file issues and feature requests.

Food For Thought

Is there anything that is totally random? - StackExchange
Randomness vs Unpredictability - Wikipedia
Can we sure that randomeness exists? - Quora

xkcd-scraper's People

Contributors

hashhar avatar ruttydm avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

xkcd-scraper's Issues

Option to create index of downloaded comics

Create a text file that contains all the json information from the api and allow the user to search for a specific comic using any of the json fields.

Use as such: xkcd-scraper search [attribute to use] [value]
eg.

xkcd-scraper search title is meta
xkcd-scraper search date between 1/1/2015 1/2/2015
xkcd-scraper search transcript "worth it"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.