Created
April 5, 2018 06:26
-
-
Save masao/799025b4fb2b53dbf0b710d0dc286c8d to your computer and use it in GitHub Desktop.
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
#!/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