script zum parsen..

A

Andre

Foren Gott
des aktuellen Kernel status gesucht!
Würde gerne die aktuellen Kerneversionen im Portal einbauen...also(stable Kernel,
Latest prepatch usw )
habt ihr bestimmt schon mal auf sites geshen :)
hab nur leider keinen schimmer wo mann ne rdf oder rss datei mit den Infos findet...geschweige denn, wie man das schön parsen könnte...

:help:
 
Schau dir dochmal ...

kernelnotes.de an.
Vielleicht solltest du einfach mal den ********** der Seite anmailen - ich habe Noel als einen sehr hilfsbereiten und kompetenten Mitgenossen bei Hostsharing erlebt. Wharscheinlich ist sein Skript auch OpenSource :)
 
thx!

das ist doch schon mal was :)

dank und Gruss Andre..
 
hmm,

also IMHO ist die Seite www.kernel.org immer gleich aufgebaut, mit ein paar Reg. Expresions sollte es eigetnlcih ein einfaches sein diese Seite zu parsen und dann weiter zu verwenden, einfach mit fopen einlesen, die Reg. Exp. drüber laufen lassen und gut ist.

Mal sehen ob och heute Nachmittag mal Zeit hab.
 
hmm,

aber hatte leider keine Zeit heute :( Morgen vielleicht.
 
wenn es was umsonst gibt...

warte ich gerne :D

schon jetzt mal nen thx! von mir ;)
 
hmm,

so hier der Code, ich hoffe die Namen entwickeln sich wirklich so weiter wie ich mir das denke :)
Code:
<?php
$fd = fopen(&quot;http://www.kernel.org&quot;,&quot;r&quot;);
while (!feof($fd)) {
    $file = fgets($fd, 4096);
if (preg_match(&quot;|(>)(2.0.)([0-9]){1,2}(<)|&quot;,$file,$match))
{
echo &quot;Die letzte stabile 2.0.x Version : &quot;.substr($match[0],1,-1).&quot;<br>&quot;;
}
if (preg_match(&quot;|(>)(2.2.)([0-9]){1,2}(<)|&quot;,$file,$match))
{
echo &quot;Die letzte stabile 2.2.x Version : &quot;.substr($match[0],1,-1).&quot;<br>&quot;;
}
if (preg_match(&quot;|(>)(2.4.)([0-9]){1,2}(<)|&quot;,$file,$match))
{
echo &quot;Die letzte stabile 2.4.x Version : &quot;.substr($match[0],1,-1).&quot;<br>&quot;;
}
if (preg_match(&quot;|(>)(2.5.)([0-9]){1,2}(<)|&quot;,$file,$match))
{
echo &quot;Die letzte 2.5.x Beta-Version : &quot;.substr($match[0],1,-1).&quot;<br>&quot;;
}
if (preg_match(&quot;|(>)(2.4.)([0-9]){1,2}(-pre)([0-9]{1,2})(<)|&quot;,$file,$match))
{
echo &quot;Die letzte prepatch 2.4.x Version : &quot;.substr($match[0],1,-1).&quot;<br>&quot;;
}
if (preg_match(&quot;|(>)(2.5.)([0-9]){1,2}(-pre)([0-9]{1,2})(<)|&quot;,$file,$match))
{
echo &quot;Die letzte prepatch 2.5.x Version : &quot;.substr($match[0],1,-1).&quot;<br>&quot;;
}
if (preg_match(&quot;|(>)(2.2.)([0-9]){1,2}(-rc)([0-9]{1,2})(<)|&quot;,$file,$match))
{
echo &quot;Die letzte prepatch 2.2.x Version : &quot;.substr($match[0],1,-1).&quot;<br>&quot;;
}
if (preg_match(&quot;|(>)(2.0.)([0-9]){1,2}(-rc)([0-9]{1,2})(<)|&quot;,$file,$match))
{
echo &quot;Die letzte prepatch 2.0.x Version : &quot;.substr($match[0],1,-1).&quot;<br>&quot;;
}
if (preg_match(&quot;|(>)(2.)([0-9]{1,2})(.)([0-9]){1,2}(-pre)([0-9]{1,2})(-ac)([0-9]{1,2})(<)|&quot;,$file,$match))
{
echo &quot;Die letzte &quot;Alan Cox&quot; Version : &quot;.substr($match[0],1,-1).&quot;<br>&quot;;
}
if (preg_match(&quot;|(>)(2.)([0-9]{1,2})(.)([0-9]){1,2}(-dj)([0-9]){1,2}(<)|&quot;,$file,$match))
{
echo &quot;Die letzte &quot;dj&quot;  Version : &quot;.substr($match[0],1,-1).&quot;<br>&quot;;
} }
?>
Ich hoffe du kannst was damit anfangen Andre
 
Zuletzt bearbeitet:
super!!

bin dir echt dankbar!!!!
nur noch nen bissel feintuning...kriege immer..
Parse error: parse error, expecting `&acute;,&acute;&acute; or `&acute;;&acute;&acute; in /home/www/web220/html/html/kernel.php on line 115
kann aber nix finden... :help:
 
hmm,

kannste das teil mal posten ?? Es kann auch sein das irgendwo ein Klammer zu fehlt !
 
konnte da keinen fehler finden

<?php


$fd = fopen(&quot;http://www.kernel.org&quot;;,&quot;r&quot;);


while (!feof($fd)) {


$file = fgets($fd, 4096);


if (preg_match(&quot;|(>)(2.0.)([0-9]){1,2}(<)|&quot;,$file,$match))


{


echo &quot;Die letzte stabile 2.0.x Version : &quot;.substr($match[0],1,-1).&quot;<br>&quot;;


}


if (preg_match(&quot;|(>)(2.2.)([0-9]){1,2}(<)|&quot;,$file,$match))


{


echo &quot;Die letzte stabile 2.2.x Version : &quot;.substr($match[0],1,-1).&quot;<br>&quot;;


}


if (preg_match(&quot;|(>)(2.4.)([0-9]){1,2}(<)|&quot;,$file,$match))


{


echo &quot;Die letzte stabile 2.4.x Version : &quot;.substr($match[0],1,-1).&quot;<br>&quot;;


}


if (preg_match(&quot;|(>)(2.5.)([0-9]){1,2}(<)|&quot;,$file,$match))


{


echo &quot;Die letzte 2.5.x Beta-Version : &quot;.substr($match[0],1,-1).&quot;<br>&quot;;


}


if (preg_match(&quot;|(>)(2.4.)([0-9]){1,2}(-pre)([0-9]{1,2})(<)|&quot;,$file,$match))


{


echo &quot;Die letzte prepatch 2.4.x Version : &quot;.substr($match[0],1,-1).&quot;<br>&quot;;


}


if (preg_match(&quot;|(>)(2.5.)([0-9]){1,2}(-pre)([0-9]{1,2})(<)|&quot;,$file,$match))


{


echo &quot;Die letzte prepatch 2.5.x Version : &quot;.substr($match[0],1,-1).&quot;<br>&quot;;


}


if (preg_match(&quot;|(>)(2.2.)([0-9]){1,2}(-rc)([0-9]{1,2})(<)|&quot;,$file,$match))


{


echo &quot;Die letzte prepatch 2.2.x Version : &quot;.substr($match[0],1,-1).&quot;<br>&quot;;


}


if (preg_match(&quot;|(>)(2.0.)([0-9]){1,2}(-rc)([0-9]{1,2})(<)|&quot;,$file,$match))


{


echo &quot;Die letzte prepatch 2.0.x Version : &quot;.substr($match[0],1,-1).&quot;<br>&quot;;


}


if (preg_match(&quot;|(>)(2.)([0-9]{1,2})(.)([0-9]){1,2}(-pre)([0-9]{1,2})(-ac)([0-9]{1,2})(<)|&quot;,$file,$match))


{


echo &quot;Die letzte &quot;Alan Cox&quot; Version : &quot;.substr($match[0],1,-1).&quot;<br>&quot;; // zeile 115!!!!!!!!!!

}


if (preg_match(&quot;|(>)(2.)([0-9]{1,2})(.)([0-9]){1,2}(-dj)([0-9]){1,2}(<)|&quot;,$file,$match))


{


echo &quot;Die letzte &quot;dj&quot; Version : &quot;.substr($match[0],1,-1).&quot;<br>&quot;;


} }


?>
 
Zuletzt bearbeitet:
hmm,

ganz einfach !

Original von andre


if (preg_match(&quot;|(>)(2.)([0-9]{1,2})(.)([0-9]){1,2}(-pre)([0-9]{1,2})(-ac)([0-9]{1,2})(<)|&quot;,$file,$match))
{
echo &quot;Die letzte &quot;Alan Cox&quot; Version : &quot;.substr($match[0],1,-1).&quot;<br>&quot;; // zeile 115!!!!!!!!!!
}
hier felhen die Backslshes vor und nach Alan Cox, du machst ja den String wieder zu mit dem &quot; Zeichen, du must es so schreiben :

echo &quot;Die letzte &quot;Alan Cox&quot; Version : &quot;.substr($match[0],1,-1).&quot;<br>&quot;; // zeile 115!!!!!!!!!!

if (preg_match(&quot;|(>)(2.)([0-9]{1,2})(.)([0-9]){1,2}(-dj)([0-9]){1,2}(<)|&quot;,$file,$match))


{


echo &quot;Die letzte &quot;dj&quot; Version : &quot;.substr($match[0],1,-1).&quot;<br>&quot;;


} }


?>

Hier auch die Backslashes vor und nach dj einfügen, selber Fehler !
 
super! der fehler ist weg ::))

..jetzt muss ich es nur noch einbauen ;)

thx!
 

Ähnliche Themen

xrandr: cant open display

Rausfinden ob Prozess XY reagiert

HD Parameter setzen Suse 10.3, lahmer gehts kaum!

[HowTo] TeamSpeak 2 - RC2 - Server (Deutsch/Englisch)

Zurück
Oben