Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How would you grab all the text from a site and store them in a variable?

Asked by 9 years ago

What I'm trying to do is use HttpService, and grab all the text from a site and store them in a variable which is exactly what I put in the title of the question.

I'm REALLY confused right now. Also HttpService is enabled.

local HttpService = game:GetService("HttpService")

That's literally all I have. I tried everything, looking in the wiki, youtube, etc. Still don't know. Is this even possible?

1 answer

Log in to vote
1
Answered by 9 years ago

Okay, first.. This MUST be a server script; it cannot be a local. Second; it MUST be a raw link, (or a php link)

This is my pastebin so you may use it :P

local Http = game:FindService('HttpService') -- Gets your provided service needed for the script.
local Link = "http://pastebin.com/raw.php?i=CGPWBjg6"
local Sync = Http:GetAsync(Link, true)

local r,e = ypcall(function()
    print( getfenv( loadstring(Sync)() ) ) -- We print the text from the raw pastebin.
end)
if not r then warn(e) end
0
Thanks! RBXData 0 — 9y
0
Accept the answer please, MessorAdmin 598 — 9y
Ad

Answer this question