This commit is contained in:
Igor Timofeev 2016-03-31 10:00:02 +03:00
parent ddc8ba107c
commit a2eb2dbe27
2 changed files with 60 additions and 14 deletions

View File

@ -750,20 +750,20 @@
["version"]=1.0, ["version"]=1.0,
}, },
----------------------------------------------------- Приложения с ресурсами -------------------------------------------------------------------------- ----------------------------------------------------- Приложения с ресурсами --------------------------------------------------------------------------
{ -- {
["name"]="MineOS/Applications/VK", -- ["name"]="MineOS/Applications/VK",
["url"]="IgorTimofeev/OpenComputers/master/Applications/VK/VK.lua", -- ["url"]="IgorTimofeev/OpenComputers/master/Applications/VK/VK.lua",
["type"]="Application", -- ["type"]="Application",
["icon"]="IgorTimofeev/OpenComputers/master/Applications/VK/Icon.pic", -- ["icon"]="IgorTimofeev/OpenComputers/master/Applications/VK/Icon.pic",
["createShortcut"]="dock", -- ["createShortcut"]="dock",
["version"]=1.0, -- ["version"]=1.0,
["resources"]={ -- ["resources"]={
{ -- {
["name"]="VKLogo.pic", -- ["name"]="VKLogo.pic",
["url"]="IgorTimofeev/OpenComputers/master/Applications/VK/VKLogo.pic", -- ["url"]="IgorTimofeev/OpenComputers/master/Applications/VK/VKLogo.pic",
}, -- },
}, -- },
}, -- },
{ {
["name"]="MineOS/Applications/FlappyBird", ["name"]="MineOS/Applications/FlappyBird",
["url"]="IgorTimofeev/OpenComputers/master/Applications/FlappyBird/FlappyBird.lua", ["url"]="IgorTimofeev/OpenComputers/master/Applications/FlappyBird/FlappyBird.lua",

View File

@ -0,0 +1,46 @@
local internet = require("component").internet
local url = "https://oauth.vk.com/token?grant_type=password&client_id=3697615&client_secret=AlVXZFMUqyrnABp8ncuU&username=Igor_Timofeev@me.com&password=3222288222238901371&v=5.50"
local response, errorMessage = internet.request(url)
if response then
local data = ""
local readedData
for key, val in pairs(response) do
print(key, val)
end
while true do
local readedData, readedReason = response.read()
if not readedData then
if readedReason then
ecs.error("Ашибачка при чтении: " .. readedReason)
break
else
break
end
else
data = data .. readedData
end
end
ecs.error("Ответ сервера: " .. tostring(data))
else
ecs.error("Ашибачка: " .. tostring(errorMessage))
end