either a socket.http problem or string.find problem

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
User avatar
rokit boy
Party member
Posts: 198
Joined: Wed Jan 18, 2012 7:40 pm

either a socket.http problem or string.find problem

Post by rokit boy »

heres part of my code:

Code: Select all

b, c, h = http.request("http://www.google.com/")

function love.draw()
	
	if string.find(table.concat(explode("\r",table.concat(explode("\n",b:lower())))),string.lower([[<div id="pocs" style="display: none; position: absolute; "><div id="pocs0"><span><span>Google</span> Instant is unavailable. Press Enter to search.</span><a href="/support/websearch/bin/answer.py?answer=186645&form=bb&hl=en-GB">Learn more</a></div><div id="pocs1"><span>Google</span> Instant is off due to connection speed. Press Enter to search.</div><div id="pocs2">Press Enter to search.</div></div>]]),1,true) then
		love.graphics.print("works!!!",0,0)
	end
	
	--love.graphics.print(table.concat(explode("\r",table.concat(explode("\n",b)))),0,0)
	--print(table.concat(explode("\n",b)))
end
ive tested it with [[<!doctype html>]] and it works, so it must be long strings, can you please help?
u wot m8
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: either a socket.http problem or string.find problem

Post by Robin »

Dude what. Have you tried printing b, so you can see what it actually contains?
Help us help you: attach a .love.
User avatar
rokit boy
Party member
Posts: 198
Joined: Wed Jan 18, 2012 7:40 pm

Re: either a socket.http problem or string.find problem

Post by rokit boy »

yes and it prints correctly
u wot m8
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: either a socket.http problem or string.find problem

Post by Robin »

If you want more help, you gotta give more information, because it looks to me like it should work. Are you sure even the white space and such is correct?
Help us help you: attach a .love.
Post Reply

Who is online

Users browsing this forum: MrFariator and 65 guests