Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- getmetadateTest
- -- ============================================
- -- == utilities
- -- ============================================
- -- -----------------
- -- getMetadatetime
- -- -----------------
- META_DATETIME_URL = "http://zzz.yyy.example.com/meta_datetime.php"
- local function getMetadatetime()
- function hazure()
- rslt = { }
- rslt.date = "1970/01/01"
- rslt.time = "00:00:00"
- rslt.dow = "Thu"
- return rslt
- end
- if "http://zzz.yyy.example.com/meta_datetime.php" == META_DATETIME_URL then
- -- url ga example-no-mama dattara nanimoshinai.
- return hazure()
- end
- local file = http.get(META_DATETIME_URL)
- if file ~= nil then
- rslt = textutils.unserialize(file.readAll())
- file.close()
- else
- rslt = hazure()
- end
- return rslt
- end
- -- ============================================
- -- == test
- -- ============================================
- res = getMetadatetime()
- print(textutils.serialize(res))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement