Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local url=...
- local key="e5000df5-6072-44d2-ad79-df80228e2123"
- if url=="help" or not url then
- print("tiny.cc <url>")
- print("Please do not abouse this program.")
- else
- local raw=http.get("http://tiny.cc/?c=rest_api&m=shorten&version=2.0.3&longUrl="..url.."&login=willwac&apiKey="..key)
- local data=raw.readLine()
- function explode()
- local pos,arr = 0,{}
- for st,sp in function() return string.find(data:sub(2),"," and ":",pos,true) end do
- table.insert(arr,string.sub(data:sub(2),pos,st-1))
- pos = sp + 1
- end
- table.insert(arr,string.sub(data:sub(2),pos))
- return arr
- end
- local t=explode()
- local u=t[5]:sub(2)..":"..t[6]:gsub("\\",""):sub(1,16)
- print("\nURL: "..u.."\nCode: "..u:sub(16))
- print("Please do not abouse this program.")
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement