Skip to content

Instantly share code, notes, and snippets.

View windoze95's full-sized avatar
🐋
Focusing

Julian DiCesare windoze95

🐋
Focusing
View GitHub Profile
@windoze95
windoze95 / gimme-them-coins.lua
Created June 24, 2017 22:12
Lua script to call coinmarketcap.com api for cryptocurrency info/ticker
local json = require("json")
function command(cmd, raw)
local f = assert(io.popen(cmd, 'r'))
local s = assert(f:read('*a'))
f:close()
if raw then return s end
s = string.gsub(s, '^%s+', '')
s = string.gsub(s, '%s+$', '')
s = string.gsub(s, '[\n\r]+', ' ')