How do i use this module script?

I came across this module script ( HTML/DOM Reader module - Resources / Community Resources - Developer Forum | Roblox) that reads gets elements from class name but the example doesnt work anymore did the twitter website change or is it just the module stop working?

-- --httprequests turned on. 

local http = game:GetService'HttpService'; 
local url = 'https://www.twitter.com/Roblox'; 
local x = require(workspace["HTML Module"]); 
local data = http:GetAsync(url); 

if data~=nil then 
	local requestedClass = 'TweetTextSize TweetTextSize--normal js-tweet-text tweet-text' --html class of a tweet, found with inspect element
	local tweets = x:getElementsByClassName(data, requestedClass, 3)--third parameter is 3, because I don't want my table to be longer than 3 rows. 
	
	for i,v in pairs(tweets) do
		print(i..': '..v); 
	end	
end
2 Likes

image
i came across this error in the module how would do i fix this? (Line 89)
Module: HTML Module [v2 in the making!] - Roblox

2 Likes

So much more trouble to have to recode this to check for errors. Please use the </> option when posting and just add the actual code not a picture of it.

Try this …

function contains(wc, c)
	for i = 1, #wc - #c + 1 do
		local n = i + #c - 1
		if wc:sub(i, n) == c then
			if wc:sub(n + 1, n + 1) == ' ' or wc:sub(n + 1, n + 1) == '  ' then
				if wc:sub(i - 1, i - 1) == ' ' or wc:sub(i - 1, i - 1) == '  ' then
					return true
				end
			end
		end
	end
	return false
end

And now I see why you used a picture … lol make sure the ’ 's are set up as you wish. Think that would also be a nil for β€˜β€™ … possibly check for string length would be an alternative.

Oh yea sorry i will do next time i post, Thanks!

Ya the ’ ’ don’t come out right … I see why you used a picture now.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.