Skip to content

Instantly share code, notes, and snippets.

@zaki
Created March 13, 2014 08:45
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 zaki/9524528 to your computer and use it in GitHub Desktop.
Save zaki/9524528 to your computer and use it in GitHub Desktop.
Checking if 艦コレ is finally open... (it's probably not anyway, but whatever)

This script checks if 艦これ has finally opened their server to new players.

They probably didn't and even if they did, the game itself is not that good anyway, but for those of us that are masochistic enough to want to analyze other games, but not have the patience to regularly check if the company has graced their unworthy person with the rarest of opportunities to play their game, now we can just get notified when an open server is found through the API.

How to use

If you don't know how to use this and can't figure it out on your own, probably you shouldn't use it. Go play flappy bird MMO http://flapmmo.com/ instead.

require 'net/http'
require 'json'
require 'terminal-notifier'
DMM_USER_ID = 0 # CHANGE THIS TO YOUR USER ID
uri = URI("http://203.104.209.7/kcsapi/api_world/get_worldinfo")
req = Net::HTTP::Post.new(uri)
req["Origin"] = "http://203.104.209.7"
req.set_form_data(api_verno: 1, api_dmmuser_id: DMM_USER_ID)
res = Net::HTTP.start(uri.hostname, uri.port) {|http| http.request(req)}
api= JSON.parse(res.body.split("=")[1])
srvs = api["api_data"]["api_world_info"]
TerminalNotifier.notify("DMM OPEN") if srvs.any? {|srv| srv["api_entry"] != 0}
source "https://rubygems.org"
gem "terminal-notifier"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment