Last active
August 29, 2015 14:05
-
-
Save meew0/7fc48d211b5cb593db82 to your computer and use it in GitHub Desktop.
NEM Update Checker
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# NotEnoughMods Update Checker | |
# Made by meew0 | |
# | |
# Requires Ruby | |
# http://ruby-lang.org/ | |
# | |
# Download as NEMCheck.rb, go into a command prompt, | |
# navigate to the folder you downloaded it to and run | |
# ruby NEMCheck.rb | |
# Easy, right? | |
# | |
# To change the list to something else, just change the "1.7.10" a couple lines below | |
require 'open-uri' | |
require 'json' | |
doc = open("http://bot.notenoughmods.com/1.7.10.json") | |
data = JSON.parse(doc.read) | |
data.each do |e| | |
last_updated = Time.at(e['lastupdated']) | |
if last_updated > (Time.now - 604800) | |
# the mod has been updated in the last 7 days | |
puts "The mod #{e['name']} has updated to version #{e['version']} on #{last_updated} - #{e['longurl']}" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment