Convert XML to LUA
 

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

Convert XML to LUA

Started by Bollebus, 28 September, 2004, 21:09:36

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Bollebus

Here are the XLM script i want to convert to lua

http://bollebus.mine.nu/isps.xml

please help me

//Bolle


Hey
i need someone who can convert XML to ptokax LUA script

i cant paste the xml script here its to long if u can convert  i can mail it to u or something

//Bolle


plop

QuoteOriginally posted by Bollebus
Hey
i need someone who can convert XML to ptokax LUA script

i cant paste the xml script here its to long if u can convert  i can mail it to u or something

//Bolle


try the search from the board.
rabitwombat posted a xml parsing script for lua.

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 <----<<

Bollebus

i have try to search for it but no answers

no one who can convert ?

//Bolle

QuoteOriginally posted by plop
QuoteOriginally posted by Bollebus
Hey
i need someone who can convert XML to ptokax LUA script

i cant paste the xml script here its to long if u can convert  i can mail it to u or something

//Bolle


try the search from the board.
rabitwombat posted a xml parsing script for lua.

plop

Bollebus

no one who can ???

please help med

//bolle

plop

QuoteOriginally posted by Bollebus
no one who can ???

please help med

//bolle
mutor posted the function for you, what more help do you need ?


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 <----<<

Bollebus

the script mutor paste to me will not work i have only past it in a txt documet and chage the name to *.lua

but the script now work so i voudering if the ip number shall paste in the script them i who is 10Mbit

i cant nothing about makeing script

//Bolle

QuoteOriginally posted by plop
QuoteOriginally posted by Bollebus
no one who can ???

please help med

//bolle
mutor posted the function for you, what more help do you need ?


plop

Bollebus

hey

i need a ip script i can put in the  ip number but i wont the script

//bolle

Psycho_Chihuahua

#7
with an xml like this...



	29145
	Psycho_Johnnie
	25.06.2004 16:17
	03.10.2004 23:23
	8d 07h 58m 58s
	4d 07h 42m 49s
	19d 03h 40m 40s
	Windows 2000
	4
	2195
	2384/6686
	[URL]http://www.uptime-project.net/profile.php?uid=29145[/URL]
	03.10.2004 23:24


where in that XML Parser would i enter like or ?

like say i enter #servtime then it should show something like this..
 Hub Server Uptime:	[$uptime]
	  Hub Server Average:	[$average]
	  Hub Uptime Record:	[$record]
	  Hub OS:		[$os SP $os_sp]
	  Stats generated:		[$generated]

any ideas?

My XML Parser (via webserver)
// Variablendefinition ->>

// Uptime Project User-ID
$config[uid] = 29145;
// (Path to) Temp-File
$config[tmp] = "serveruptime.dat";

// <<- Variablendefinition



// Programmablauf ->>

if(@filemtime($config[tmp]) <= time() - 1800 || @filesize($config[tmp]) == 0)
{
	
$input_xml = @fopen("http://data.uptime-project.net/xml.php?uid=$config[uid]","r");
	
$input = @fread($input_xml,2048);
	
@
fclose($input_xml);
	

	
if(
$input)
	
{
	
	
$tmpfile = @fopen($config[tmp],w);
	
	
if(
$tmpfile)
	
	
{
	
	
	
@
fwrite($tmpfile,$input);
	
	
}
	
	
else
	
	
{
	
	
	
echo 
"Kann nicht in Temp-File schreiben. Fehlende Rechte.";
	
	
	
exit;
	
	
}
	
	
@
fclose($tmpfile);
	
}
	

	
unset(
$input,$input_xml,$tmpfile);
}

$tmpfile = @fopen($config[tmp],r);
$input = @fread($tmpfile,2048);

if(
$input)
{
	
$parser xml_parser_create();
	
xml_parse_into_struct($parser,$input,$values);
	
xml_parser_free($parser);
	

	
$xml = array();
	

	
foreach(
$values as $data)
	
{
	
	
if(
$data[tag] != "PROFILE")
	
	
{
	
	
	
$xml[strtolower($data[tag])] = $data[value];
	
	
}
	
}
}
else
{
	
echo 
"Kann Temp-Datei $config[tmp] nicht lesen.";
	
exit;
}

@
fclose($tmpfile);
unset(
$tmpfile,$input,$parser,$values,$data);

// <<- Programmablauf
header("Content-type: image/png"); 
$image imagecreatefrompng("uptime10.png"); 
$black imagecolorallocate($image0,0,0); 
$font_size 7.5
ImageTTFText ($image$font_size06022$black"fonts/tahoma.ttf","User: $xml[username]"); 
ImageTTFText ($image$font_size06032$black"fonts/tahoma.ttf","Uptime: $xml[uptime]"); 
ImageTTFText ($image$font_size06042$black"fonts/tahoma.ttf","Record: $xml[record]"); 
ImageTTFText ($image$font_size06052$black"fonts/tahoma.ttf","OS: $xml[os] SP $xml[os_sp]"); 
ImageTTFText ($image704068$black"fonts/tahoma.ttf","Stats generiert: $xml[generated]"); 
imagepng($image); 
imagedestroy($image);
?>

PtokaxWiki ?PtokaX Mirror + latest Libs

01100001011011000111001101101111001000000110101101101110011011110111011101101110001000000110000101110011001000000101010001101111011010110110111101101100011011110111001101101000

Psycho_Chihuahua

anyone got an Idea???
PtokaxWiki ?PtokaX Mirror + latest Libs

01100001011011000111001101101111001000000110101101101110011011110111011101101110001000000110000101110011001000000101010001101111011010110110111101101100011011110111001101101000

Psycho_Chihuahua

#9
QuoteOriginally posted by Mutor
save the output of that php script to a text file that is of little use. I will be  working on an XML  solution. I am nearly finished with a revised version of the Web Reader script. Next on the chopping block is XML. Will post as soon as I have something of consequence.


well the xml only gets updated every 30 mins at max (<= time() - 1800 || @filesize($config[tmp]) == 0 ) which is the time it takes the uptime project servers to update and is then used as cached data in "serveruptime.dat" for the next 30 minutes, in other words its always accurate +- 29 minutes, so changing its path and ending is not a problem. looking forward to something a bit easier to use ^^ but no need to hurry



edited

i have changed my output file to a pure xml named serveruptime.xml...



	29145
	Psycho_Johnnie
	25.06.2004 16:17
	03.10.2004 23:23
	8d 07h 58m 58s
	4d 07h 42m 49s
	19d 03h 40m 40s
	Windows 2000
	4
	2195
	2384/6686
	[URL]http://www.uptime-project.net/profile.php?uid=29145[/URL]
	03.10.2004 23:24

PtokaxWiki ?PtokaX Mirror + latest Libs

01100001011011000111001101101111001000000110101101101110011011110111011101101110001000000110000101110011001000000101010001101111011010110110111101101100011011110111001101101000

plop

why not use uptime.exe from M$.
 PtokaX 10 day(s), 15 hour(s) 33 minute(s), 54 second(s) 
  Server 17 day(s), 20 hour(s), 34 minute(s), 41 second(s)
if you enable enough logging in windows you can get even more info.
Since 3-6-2004:

           System Availability: 99.3717%
                  Total Uptime: 122d 23h:41m:46s
                Total Downtime: 0d 18h:39m:48s
                 Total Reboots: 14
     Mean Time Between Reboots: 8.84 days
             Total Bluescreens: 0

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 <----<<

Psycho_Chihuahua

#11
i know of that one plop, just seeming that i have the xml anyway i would like to be able to use it as well...

I have the XML saved localy anyway thanks to the uptime project where i make my own images.

I would just like to know how i can use the certain keywords from the XML in a Hubscript like for instance $xml[uptime] for the xml variable XXXX found in the x.xml

I use various XML's for:

The Uptime Project (for my own Uptime Images)
SETI (also for own Images to display on website)
BOINC
Homepage

so if i had a script for something in that case i could adapt it to my needings ^^
 
PtokaxWiki ?PtokaX Mirror + latest Libs

01100001011011000111001101101111001000000110101101101110011011110111011101101110001000000110000101110011001000000101010001101111011010110110111101101100011011110111001101101000

Bollebus

Hey

i need a script there im write the ip number who let get in on my hub  

can u write thats script

//Bolle

QuoteOriginally posted by Mutor
I dont understand your request. Please explain what you want to do.

Psycho_Chihuahua

QuoteOriginally posted by Psycho_Chihuahua
I have the XML saved localy anyway thanks to the uptime project where i make my own images.

I would just like to know how i can use the certain keywords from the XML in a Hubscript like for instance $xml[uptime] for the xml variable XXXX found in the x.xml

I use various XML's for:

The Uptime Project (for my own Uptime Images)
SETI (also for own Images to display on website)
BOINC
Homepage

so if i had a script for something in that case i could adapt it to my needings ^^
 
PtokaxWiki ?PtokaX Mirror + latest Libs

01100001011011000111001101101111001000000110101101101110011011110111011101101110001000000110000101110011001000000101010001101111011010110110111101101100011011110111001101101000

Bollebus

no one who have or can write some to me ??

//Bolle

QuoteOriginally posted by Bollebus
Here are the XLM script i want to convert to lua

http://bollebus.mine.nu/isps.xml

please help me

//Bolle


Hey
i need someone who can convert XML to ptokax LUA script

i cant paste the xml script here its to long if u can convert  i can mail it to u or something

//Bolle



SMF spam blocked by CleanTalk