Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
[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