snipplets.dev/~/Crystal/http_client.cr

12 lines
272 B
Crystal
Raw Normal View History

2022-10-08 01:23:54 +03:00
require "json"
require "http/client"
minecraft_url = "https://launchermeta.mojang.com/mc/game/version_manifest_v2.json"
response = HTTP::Client.get minecraft_url
version_manifest = JSON.parse(response.body)
version = version_manifest["latest"]["release"]
puts version