Skip to content

Instantly share code, notes, and snippets.

@keisei1092
Created January 13, 2019 12:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save keisei1092/17e5060ff6b961af80222c8a388b3655 to your computer and use it in GitHub Desktop.
Save keisei1092/17e5060ff6b961af80222c8a388b3655 to your computer and use it in GitHub Desktop.
[WIP] Danbooru Downloader
require 'httparty'
dir = File.expand_path(File.join(File.dirname(__FILE__), '..', 'downloaded'))
response = HTTParty.get 'https://gelbooru.com/index.php?page=dapi&s=post&q=index&tags=hatsune_miku&json=1'
response
.parsed_response
.map { |r| { r['file_url'] } }
.tap { |r| puts r }
# .each { |u|
# File.open(u, "w") { |f|
# response = HTTParty.get(u, str)
# }
# }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment