site-reader
 

News:

29 December 2022 - PtokaX 0.5.3.0 (20th anniversary edition) released...
11 April 2017 - PtokaX 0.5.2.2 released...
8 April 2015 Anti child and anti pedo pr0n scripts are not allowed anymore on this board!
28 September 2015 - PtokaX 0.5.2.1 for Windows 10 IoT released...
3 September 2015 - PtokaX 0.5.2.1 released...
16 August 2015 - PtokaX 0.5.2.0 released...
1 August 2015 - Crowdfunding for ADC protocol support in PtokaX ended. Clearly nobody want ADC support...
30 June 2015 - PtokaX 0.5.1.0 released...
30 April 2015 Crowdfunding for ADC protocol support in PtokaX
26 April 2015 New support hub!
20 February 2015 - PtokaX 0.5.0.3 released...
13 April 2014 - PtokaX 0.5.0.2 released...
23 March 2014 - PtokaX testing version 0.5.0.1 build 454 is available.
04 March 2014 - PtokaX.org sites were temporary down because of DDOS attacks and issues with hosting service provider.

Main Menu

site-reader

Started by TyShkan, 17 August, 2004, 18:00:07

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

TyShkan

GETHTML = "GET /lol.php HTTP/1.1\r\nHost: xhub.ultranet.ru\r\nUser-Agent: Mozilla/4.0 (compatible; LUA 4.0; LUA 4.0)\r\n"

Bot = "::[X]::"

function GetNews(user)
	local socket, err = connect("xhub.ultranet.ru", 80)
	local code = ""
	if not err then
		socket:timeout(2)
		socket:send(GETHTML..strchar(13,10))
		local line = ""
		while not err do
			line, err = socket:receive("*l")
			code = code..line
		end
		socket:close()
	end
	socket:close()
	user:SendData(Bot, code)
end

function DataArrival(user, data)
	if (strsub(data,1,1) == "<" or strsub(data,1,5+strlen(Bot)) == "$To: "..Bot) then
		data = strsub(data,1,strlen(data)-1)
		s,e,cmd = strfind(data, "%b<>%s+(%S+)")
		if (cmd == "!go") then
			GetNews(user)
		end
	end
end


Page is now accessible at http://xhub.ultranet.ru/lol.php and contains code:
Hi!))\r\n\r\nOooOoooOooo


When i writing !go, this script return code:
HTTP/1.1 200 OKDate: Mon, 16 Aug 2004 10:24:33 GMTServer: Apache/1.3.29 (Unix) mod_become/1.3 PHP/4.3.5 mod_layout/3.2X-Powered-By: PHP/4.3.5Connection: closeTransfer-Encoding: chunkedContent-Type: text/html14 Hi!))\r\n\r\nOooOoooOooo0


What i would change, that the script would understand "\n", etc and showing code:
Hi!))\r\n\r\nOooOoooOooo
as code:
Hi!))

OooOoooOooo
in dc? And how i can check, are there changes on the site and if they are not present to read beforehand saved version from a file...

Thanks, --X--

plop

no need 2 change anything, dc++ handles the \r\n as a new line.
when you type it yourself from the chat, dc++ escapes it so it shows as plain text.

plop
http://www.plop.nl lua scripts/howto\'s.
http://www.thegoldenangel.net
http://www.vikingshub.com
http://www.lua.org

>>----> he who fights hatred with hatred, drives the spreading of hatred <----<<

TyShkan

hm, sorry, but i seen that, when enter command "!go":
[21:52:00] <::[X]::> HTTP/1.1 200 OKDate: Tue, 17 Aug 2004 17:51:59 GMTServer: Apache/1.3.29 (Unix) mod_become/1.3 PHP/4.3.5 mod_layout/3.2X-Powered-By: PHP/4.3.5Connection: closeTransfer-Encoding: chunkedContent-Type: text/html18 Hi!))\r\n\r\nOooOoooOooo0

TyShkan

Why ptokax showing "\r\n"???

SMF spam blocked by CleanTalk