From a2eb2dbe27bfabf29c8c293a48a5066169131f6a Mon Sep 17 00:00:00 2001 From: Igor Timofeev Date: Thu, 31 Mar 2016 10:00:02 +0300 Subject: [PATCH] aefaef --- Applications.txt | 28 +++++++++++----------- Applications/VK/untitled.lua | 46 ++++++++++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+), 14 deletions(-) create mode 100644 Applications/VK/untitled.lua diff --git a/Applications.txt b/Applications.txt index 2011fc31..341d81fe 100644 --- a/Applications.txt +++ b/Applications.txt @@ -750,20 +750,20 @@ ["version"]=1.0, }, ----------------------------------------------------- Приложения с ресурсами -------------------------------------------------------------------------- - { - ["name"]="MineOS/Applications/VK", - ["url"]="IgorTimofeev/OpenComputers/master/Applications/VK/VK.lua", - ["type"]="Application", - ["icon"]="IgorTimofeev/OpenComputers/master/Applications/VK/Icon.pic", - ["createShortcut"]="dock", - ["version"]=1.0, - ["resources"]={ - { - ["name"]="VKLogo.pic", - ["url"]="IgorTimofeev/OpenComputers/master/Applications/VK/VKLogo.pic", - }, - }, - }, + -- { + -- ["name"]="MineOS/Applications/VK", + -- ["url"]="IgorTimofeev/OpenComputers/master/Applications/VK/VK.lua", + -- ["type"]="Application", + -- ["icon"]="IgorTimofeev/OpenComputers/master/Applications/VK/Icon.pic", + -- ["createShortcut"]="dock", + -- ["version"]=1.0, + -- ["resources"]={ + -- { + -- ["name"]="VKLogo.pic", + -- ["url"]="IgorTimofeev/OpenComputers/master/Applications/VK/VKLogo.pic", + -- }, + -- }, + -- }, { ["name"]="MineOS/Applications/FlappyBird", ["url"]="IgorTimofeev/OpenComputers/master/Applications/FlappyBird/FlappyBird.lua", diff --git a/Applications/VK/untitled.lua b/Applications/VK/untitled.lua new file mode 100644 index 00000000..bae429a7 --- /dev/null +++ b/Applications/VK/untitled.lua @@ -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 + + + + + + + + + + + + +