Tekst van site ophalen

Gestart doorBartv27 reacties73 weergaven

28 berichten · pagina 1 van 2

Bartv

Lid · Topicstarter

Berichten
4.451
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Hallo,

Ik heb een vraagje, hoe kan ik van een site tekst halen?
een vriend van mij heeft dit gemaakt:
Klik
Hier kan je de roosterwijzigingen van de klas h3d zien, dat is van deze site gehaald:
http://www.pontes.nl/~rooster/parse.php

en zoek dan naar alle h3d rooster wijzigingen,
Hoe doe ik zoiets?

P.S. Kan iemand zon voorbeeldje maken van deze site?:
http://roosters5.gepro-osi.nl/roosters/rooster.php?klassen[]=nV1g&type=Klasrooster&wijzigingen=1&school=507
Gr Bart
0
Berichten
10.421
Reputatie
4
Punten
0,00
Lid sinds
Laatst gezien
file_get_contents() en een slootje reguliere expressies.
0
Bartv

Lid · Topicstarter

Berichten
4.451
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Dat lukt me niet, ik heb nu dit:

[COLOR= #0000BB]<?php
    $raw[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/explode"]explode[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]<tbody>[/COLOR][COLOR= #007700],[/COLOR][URL="http://www.php.net/file_get_contents"]file_get_contents[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"http://roosters5.gepro-osi.nl/roosters/rooster.php?klassen[]="[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]k[/COLOR][COLOR= #007700]] .[/COLOR] [COLOR= #DD0000]"&type=Klasrooster&wijzigingen=1&school=507"[/COLOR][COLOR= #007700]));[/COLOR]
    [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<table border="1">[/COLOR][COLOR= #007700];[/COLOR]
    [URL="http://www.php.net/foreach"]foreach[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$raw[/COLOR] [COLOR= #007700]as[/COLOR] [COLOR= #0000BB]$v[/COLOR][COLOR= #007700]) {[/COLOR]
        [URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][URL="http://www.php.net/preg_match"]preg_match[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]<tr>(.*)</tr>[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$v[/COLOR][COLOR= #007700])) {[/COLOR]
            [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<tr>[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$v[/COLOR][COLOR= #007700];
        }[/COLOR]
        [URL="http://www.php.net/else"]else[/URL]
        [COLOR= #007700]{[/COLOR]
            [URL="http://www.php.net/echo"]echo[/URL][COLOR= #DD0000]Niks[/COLOR][COLOR= #007700];
        }
    }[/COLOR]
    [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]</table>[/COLOR][COLOR= #007700];[/COLOR]
?>
0
Berichten
10.421
Reputatie
4
Punten
0,00
Lid sinds
Laatst gezien
Okee? Wat lukt er dan niet aan?
0
Bartv

Lid · Topicstarter

Berichten
4.451
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Keigrote bump
0
Fass

Lid

Berichten
3.771
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Je hebt niet eens een ?k= in je link?
0
Bartv

Lid · Topicstarter

Berichten
4.451
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Fass schreef:
Je hebt niet eens een ?k= in je link?
Ja maar als je dat wel doet krijg je alsnog hetzelfde
0
Berichten
10.421
Reputatie
4
Punten
0,00
Lid sinds
Laatst gezien
Is het niet preg_match_all()?
0
Bartv

Lid · Topicstarter

Berichten
4.451
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Aarclay schreef:
Is het niet preg_match_all()?
gedaan, maar helpt niet
heb nu dit:

[COLOR= #0000BB]<?php
    $raw[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/explode"]explode[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]<tbody>[/COLOR][COLOR= #007700],[/COLOR][URL="http://www.php.net/file_get_contents"]file_get_contents[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"http://roosters5.gepro-osi.nl/roosters/rooster.php?klassen[]="[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]k[/COLOR][COLOR= #007700]] .[/COLOR] [COLOR= #DD0000]"&type=Klasrooster&wijzigingen=1&school=507"[/COLOR][COLOR= #007700]));[/COLOR]
    [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<table border="1">[/COLOR][COLOR= #007700];[/COLOR]
    [URL="http://www.php.net/foreach"]foreach[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$raw[/COLOR] [COLOR= #007700]as[/COLOR] [COLOR= #0000BB]$v[/COLOR][COLOR= #007700]) {[/COLOR]
        [URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][URL="http://www.php.net/preg_match_all"]preg_match_all[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]<tr>(.*)</tr>[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$v[/COLOR][COLOR= #007700])) {[/COLOR]
            [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<tr>[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$v[/COLOR][COLOR= #007700];
        }[/COLOR]
        [URL="http://www.php.net/else"]else[/URL]
        [COLOR= #007700]{[/COLOR]
            [URL="http://www.php.net/echo"]echo[/URL][COLOR= #DD0000]Niks[/COLOR][COLOR= #007700];
        }
    }[/COLOR]
    [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]</table>[/COLOR][COLOR= #007700];[/COLOR]
?>
0
Fass

Lid

Berichten
3.771
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
doe anders var_dump($raw); ?
0
Berichten
10.421
Reputatie
4
Punten
0,00
Lid sinds
Laatst gezien
wat staat er in $raw, kijk eens met print_r()?
0
Fass

Lid

Berichten
3.771
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Aarclay schreef:
wat staat er in $raw, kijk eens met print_r()?
Nee met vardump redface
0
Bartv

Lid · Topicstarter

Berichten
4.451
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
gedaan met print_r
0
Fass

Lid

Berichten
3.771
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Eigenwijs kind.
0

Jouw reactie

Deel je idee, stel een vraag of help een ander verder.

Editor laden…

Praat mee met de One2xs-community.

Inloggen om te reageren