Skip to content

Instantly share code, notes, and snippets.

@yogthos
Last active March 30, 2024 17:36
Show Gist options
  • Star 35 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save yogthos/d9d2324016f62d151c9843bdac3c0f23 to your computer and use it in GitHub Desktop.
Save yogthos/d9d2324016f62d151c9843bdac3c0f23 to your computer and use it in GitHub Desktop.
script to download walpapers from windowsonearth.org

installation

  1. install Node.js
  2. install Lumo: npm install -g lumo-cljs
  3. save script locally
  4. run the script with the URL, e.g:
    ./gallery.cljs "http://www.windowsonearth.org/services/api/json/1.4.0/?galleryType=album&albumId=37434732&albumKey=TBQqg7&nodeId=FDP9N&PageNumber=0&imageId=0&imageKey=&returnModelList=true&PageSize=16&imageSizes=L%2CXL&method=rpc.gallery.getalbum"

gallery list

  • Night Lights - http://www.windowsonearth.org/services/api/json/1.4.0/?galleryType=album&albumId=37344726&albumKey=6kQLh9&nodeId=HnNLw&PageNumber=0&imageId=0&imageKey=&returnModelList=true&PageSize=30&imageSizes=X2%2CX3&method=rpc.gallery.getalbum
  • Glaciers - http://www.windowsonearth.org/services/api/json/1.4.0/?galleryType=album&albumId=37403539&albumKey=S8TJBC&nodeId=HXf83&PageNumber=0&imageId=0&imageKey=&returnModelList=true&PageSize=30&imageSizes=X2%2CX3&method=rpc.gallery.getalbum
  • Glorious Earth - http://www.windowsonearth.org/services/api/json/1.4.0/?galleryType=album&albumId=52574604&albumKey=Sd8tWH&nodeId=Wd8XTq&PageNumber=0&imageId=0&imageKey=&returnModelList=true&PageSize=14&imageSizes=M%2CL&method=rpc.gallery.getalbum
  • Most Popular - http://www.windowsonearth.org/services/api/json/1.4.0/?galleryType=album&albumId=47556713&albumKey=Ctf9F7&nodeId=2kf6x&PageNumber=0&imageId=0&imageKey=&returnModelList=true&PageSize=30&imageSizes=X2%2CX3&method=rpc.gallery.getalbum
  • Cupola Views - http://www.windowsonearth.org/services/api/json/1.4.0/?galleryType=album&albumId=57712022&albumKey=KR9cwp&nodeId=rt6SwR&PageNumber=0&imageId=0&imageKey=&returnModelList=true&PageSize=14&imageSizes=XL%2CX2&method=rpc.gallery.getalbum
  • North America - http://www.windowsonearth.org/services/api/json/1.4.0/?galleryType=album&albumId=44089914&albumKey=3MKq54&nodeId=DP7bM&PageNumber=0&imageId=0&imageKey=&returnModelList=true&PageSize=30&imageSizes=X2%2CX3&method=rpc.gallery.getalbum
  • South America - http://www.windowsonearth.org/services/api/json/1.4.0/?galleryType=album&albumId=44089923&albumKey=6mm3w3&nodeId=k5PL8&PageNumber=0&imageId=0&imageKey=&returnModelList=true&PageSize=30&imageSizes=X2%2CX3&method=rpc.gallery.getalbum
  • Europe - http://www.windowsonearth.org/services/api/json/1.4.0/?galleryType=album&albumId=44089906&albumKey=MGWwk6&nodeId=gS2cx&PageNumber=0&imageId=0&imageKey=&returnModelList=true&PageSize=30&imageSizes=X2%2CX3&method=rpc.gallery.getalbum
  • Africa - http://www.windowsonearth.org/services/api/json/1.4.0/?galleryType=album&albumId=44089935&albumKey=XRCm4Z&nodeId=6wDBX&PageNumber=0&imageId=0&imageKey=&returnModelList=true&PageSize=30&imageSizes=X2%2CX3&method=rpc.gallery.getalbum
  • Asia - http://www.windowsonearth.org/services/api/json/1.4.0/?galleryType=album&albumId=44089928&albumKey=wVcXTX&nodeId=ZpN6x&PageNumber=0&imageId=0&imageKey=&returnModelList=true&PageSize=30&imageSizes=X2%2CX3&method=rpc.gallery.getalbum
  • Australia / New Zealand - http://www.windowsonearth.org/services/api/json/1.4.0/?galleryType=album&albumId=44096028&albumKey=ZBLvbJ&nodeId=M7fLK&PageNumber=0&imageId=0&imageKey=&returnModelList=true&PageSize=30&imageSizes=X2%2CX3&method=rpc.gallery.getalbum
  • Art Gallery - http://www.windowsonearth.org/services/api/json/1.4.0/?galleryType=album&albumId=43860666&albumKey=3bSfrB&nodeId=VsTsV&PageNumber=0&imageId=0&imageKey=&returnModelList=true&PageSize=30&imageSizes=X2%2CX3&method=rpc.gallery.getalbum
  • Atlantic - http://www.windowsonearth.org/services/api/json/1.4.0/?galleryType=album&albumId=44089952&albumKey=HFkcz8&nodeId=nChbw&PageNumber=0&imageId=0&imageKey=&returnModelList=true&PageSize=30&imageSizes=X2%2CX3&method=rpc.gallery.getalbum
  • Pacific - http://www.windowsonearth.org/services/api/json/1.4.0/?galleryType=album&albumId=44089964&albumKey=WKj2sc&nodeId=7fVVQ&PageNumber=0&imageId=0&imageKey=&returnModelList=true&PageSize=30&imageSizes=X2%2CX3&method=rpc.gallery.getalbum

Steps to find a gallery URL:

  • go to http://www.windowsonearth.org and select the gallery you wish to download
  • open the network tab in the browser and look for the XHR request with the method=rpc.gallery.getalbum option, e.g: http://www.windowsonearth.org/services/api/json/1.4.0/?galleryType=album&albumId=37434732&albumKey=TBQqg7&nodeId=FDP9N&PageNumber=0&imageId=0&imageKey=&returnModelList=true&PageSize=16&imageSizes=L%2CXL&method=rpc.gallery.getalbum
@iku000888
Copy link

Just wanted to drop a thanks for this sample.
It has a lot of good examples when it is your first dive into lumo :)

@crocket
Copy link

crocket commented Jul 20, 2018

I think lines 1-9 can improve.

#!/usr/bin/env lumo
(require '[cljs.nodejs :as node]
         '[clojure.pprint :refer [pprint]]
         '[clojure.string :as string :refer [join split starts-with?]]
         'http
         'https
         'fs)

(node/enable-util-print!)
(js/process.on "uncaughtException" js/console.error)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment