PtokaX forum

Archive => Archived 4.0 boards => Request for Lua 4 scripts => Topic started by: Alexandros on 27 March, 2004, 21:34:06

Title: show data from html
Post by: Alexandros on 27 March, 2004, 21:34:06
is there any way to get data from a html, and show it in PM.
so someone say !test and it shows that...i don't know if it can be done, the html refreshes every 40 secs.
this is the html: http://www.futbolargentino.com.ar/scor/parti.html
i only need to show the things in BOLD and the things on the right "Segundo Tiempo", "final", etc...
maybe is impossible or too hard, but, maybe not :)
or give me an example for the first line and i complete the rest.

thanks again :)

Alex
Title:
Post by: Alexandros on 28 March, 2004, 20:04:19
I think then there is no way to do this? or something to get the page to a TXT and then ptokax use that TXT? any soft and scritp to do that?
thanks

alex
Title:
Post by: b_w_johan on 29 March, 2004, 11:09:54
heey alexandros,
maybe this will help.. it reads a .txt
and sends it pm or in main


--this is for main
function DataArrival(user,data)
if strfind(data, "!Readfile",1,1) then -- replace !Readfile with whatever
   readfrom("mytext.txt")
   while 1 do
      line = read()
      if line == nil then break end
      SendToAll(botname,line)
      end
   readfrom()
   end
end


--and thisone for PM
function DataArrival(user,data)
if strfind(data, "!version",1,1) then
   readfrom("yourtext.txt")
   while 1 do
      line = read()
      if line == nil then break end
      user:SendPM(botname,line)
      end
   readfrom()
   end
end

--or do both
function DataArrival(user,data)
if strfind(data, "!version",1,1) then
   readfrom("yourtext.txt")
   while 1 do
      line = read()
      if line == nil then break end
      SendToAll(botname,line)
      user:SendPM(botname,line)
      end
   readfrom()
   end
end
greetings,
Johan :P
Title:
Post by: plop on 29 March, 2004, 13:10:20
QuoteOriginally posted by Alexandros
I think then there is no way to do this? or something to get the page to a TXT and then ptokax use that TXT? any soft and scritp to do that?
thanks

alex
the problem is the source of the site, it's messy and as a result hard 2 get the stuff from it.
beside that the hub freezes while it grabs the data from the site, so not a good idea.
but you can use the script from johan if you also run a app behind the scenes 2 grab the html and convert that 2 txt.
google a bit for web macro's.

plop
Title:
Post by: Alexandros on 29 March, 2004, 18:07:46
thanks, now i only need a html2txt, i found 2 or 3, but i need that they refrefh the txt every 1 or 2 minutes...if anyone know one that do that...

thanks

alex
Title:
Post by: Alexandros on 31 March, 2004, 07:16:46
QuoteOriginally posted by Alexandros
thanks, now i only need a html2txt, i found 2 or 3, but i need that they refrefh the txt every 1 or 2 minutes...if anyone know one that do that...

thanks

alex

anyone knows a program to do this??(