Giter Club home page Giter Club logo

redditwallgrab's Introduction

##Reddit Wallpaper Grabber

###Overview Basically I was sick of downloading each awesome wallpaper I saw on the /r/wallpapers subreddit by hand so I wrote this script to address that. It provides customizable options provided through command line arguments to choose from the top wallpapers based on a timeframe, and from the new wallpapers being posted. Ideally you could add this to a cron/launchd/scheduled task to download the best wallpapers to add to your desktop rotation :)

###Running

  • Start by saving, forking or cloning the script locally as a .rb file.
  • Once saved you will be able to run it with your local ruby interpreter. Start by running the script with the command line argument -h:

rocket:reddit_wallpaper_grabber jm$ ruby reddit_wall_grab.rb -h

Usage: reddit_wall_grab.rb [options]`

-v Verbose output

-h Display this screen.

-t time Grab the top wallpapers with specified time (hour, day, month, year, all).

-l N If We should limit how many 'pages' we traverse. Default is 20.

-n Grab the newest wallpapers.

-i Use imgur image links only.

-d dir Directory to download wallpapers to. Default is ./wallpapers.

-s subreddit Subreddit to download wallpapers from. Default is wallpapers. (Also takes sorting such as wallpapers/new)

Sweet, so now that you have the help output go ahead and provide command line arguments, for example if I wanted the top wallpapers of all time, and wanted the top 5000 of them I can do:

rocket:reddit_wallpaper_grabber jm$ ruby reddit_wall_grab.rb -t all -l 200

Downloading wallpaper from http://i.imgur.com/wvunc.jpg to wallpapers...

Downloading wallpaper from http://ngm.nationalgeographic.com/your-shot/weekly-wrapper/2012/img/1012wallpaper-week-3-1_1600.jpg to wallpapers...

Downloading wallpaper from http://imgur.com/HQSjesL.jpg to wallpapers...

Downloading wallpaper from http://i.imgur.com/yWWV0.jpg to wallpapers...

Downloading wallpaper from http://i.imgur.com/p5fLTnB.jpg to wallpapers...

Downloading wallpaper from http://i.imgur.com/Nan6u5i.jpg to wallpapers...

Downloading wallpaper from http://i.imgur.com/NfLI9W0.jpg to wallpapers...

Downloading wallpaper from http://i.imgur.com/X7lsZet.jpg to wallpapers...

Downloading wallpaper from http://i.imgur.com/3eEC52y.jpg to wallpapers...

Downloading wallpaper from http://i.imgur.com/tOaYBJk.jpg to wallpapers...

Downloading wallpaper from http://i.imgur.com/QQ3O6PO.jpg to wallpapers...

--snip--

You're probably wondering why 5000 if I only gave a limit of 200? Well each page count by default is 25, so 25*200 = 5000 wallpapers!

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.