Ledger Nano X - The secure hardware wallet
SHARE
TWEET

getmetadateTest

kssr3951 May 13th, 2018 54 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -- getmetadateTest
  2. -- ============================================
  3. -- == utilities
  4. -- ============================================
  5. -- -----------------
  6. -- getMetadatetime
  7. -- -----------------
  8. META_DATETIME_URL = "http://zzz.yyy.example.com/meta_datetime.php"
  9. local function getMetadatetime()
  10.   function hazure()
  11.     rslt = { }
  12.     rslt.date = "1970/01/01"
  13.     rslt.time = "00:00:00"
  14.     rslt.dow  = "Thu"
  15.     return rslt
  16.   end
  17.   if "http://zzz.yyy.example.com/meta_datetime.php" == META_DATETIME_URL then
  18.      -- url ga example-no-mama dattara nanimoshinai.
  19.      return hazure()
  20.   end
  21.   local file = http.get(META_DATETIME_URL)
  22.   if file ~= nil then
  23.     rslt = textutils.unserialize(file.readAll())
  24.     file.close()
  25.   else
  26.     rslt = hazure()
  27.   end
  28.   return rslt
  29. end
  30. -- ============================================
  31. -- == test
  32. -- ============================================
  33. res = getMetadatetime()
  34. print(textutils.serialize(res))
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top