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

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

Asked by 8 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
Answered by 8 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 = ""
local Sync = Http:GetAsync(Link, true)

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

Answer this question