Skip to content

Instantly share code, notes, and snippets.

@meew0
Last active August 29, 2015 14:05
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save meew0/7fc48d211b5cb593db82 to your computer and use it in GitHub Desktop.
Save meew0/7fc48d211b5cb593db82 to your computer and use it in GitHub Desktop.
NEM Update Checker
# 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