Skip to content

Instantly share code, notes, and snippets.

@masao
Created April 5, 2018 06:26
Show Gist options
  • Save masao/799025b4fb2b53dbf0b710d0dc286c8d to your computer and use it in GitHub Desktop.
Save masao/799025b4fb2b53dbf0b710d0dc286c8d to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
require "time"
require "open-uri"
require "json"
require "fileutils"
cont = open("http://savemlak.jp/savemlak/api.php?action=query&prop=info&titles=Mediawiki:Sitenotice&format=json")
data = JSON.load cont
mtime = Time.parse(data["query"]["pages"].values.first["touched"])
FileUtils.touch("/var/www/html/savemlak/sitenotice", mtime: mtime)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment