Skip to content

AndrejKolar/scrape

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

scrape

Download images from wallhaven.cc

Command line app that downloads random wallpapers in a specified size from wallhaven. App scrapes the site for the link, deletes old files and downloads new ones in the images folder. That folder can be used as a source for desktop backgrounds on OSX.

image

installation

App uses Bundler to handle dependancies.

If Bundler is not installed:

 gem install bundler

Run in the app folder

 bundle install

configuration

In scrape.rb

START_LINK = "http://alpha.wallhaven.cc/search?categories=111&purity=100&resolutions=2560x1440&sorting=random&order=desc"
IMAGE_FOLDER = "./images/"

Starting link contains params for the wallpaper filter like categories, purity, resolutions, sorting and order. Image folder where images are store can be changed here.

run

Enter

 ./scrape.rb

automate

An alias can be created to run the app quickly

Add to .zshrc or other shell equvalent

alias scrape="(cd /Users/andrejkolar/Projects/scrape/; ./scrape.rb)"

To run, in any shell

 scrape

gems

nokogiri gem is used to scrape image URLs from wallhaven.

mechanize gem is used to download images from URLs.

open_uri_redirections gem is to fix http => https redirections.

About

Ruby script for downloading images from wallhaven.cc

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages