andrisp Posted September 12, 2005 Report Share Posted September 12, 2005 http://www.meteo.lv/public/26492.html sheit ir virspuseejas laikazinjas pa latvijas regjioniem, ko man gribeetos kautkaadaa veidaa savaakt un apstraadaat ar php.. man tieshi interesee vidzeme, bet probleema taa, ka html kods nesatur nekaadus class vai id peec ko vareetu vadiities.. varbuut kaads var dot kaadus padomus, kaa izdabuut vajadziigo informaaciju no shiis lapas.. ps. es iisti nezinu, neesmu papeetiijis, bet izskataas, ka shis links katru reizi vareetu buut jauns.. varbuut ir veel kaads resurss, kur var dabuut laika zinjas vidzemes regjionaa ? ps2. izmantoju searchu, bet no piedaavaatajiem topiciem man nekas nedereeja. Link to comment Share on other sites More sharing options...
andrisp Posted September 12, 2005 Author Report Share Posted September 12, 2005 atradu veelvienu vietu, kur vareetu smuki dabuut laika zinjas http://www.va.lv/musu/ kods ir shitaads: <table class="top_tab1" width="100%" height="100" cellspacing="0" cellpadding="0" border="0"> <tr> <td height="10" width="100%" class="menu_topaa"> <div class="c1"> Laika ziņas </div> </td> </tr> <tr> <td> <table width="100%" height="100%" cellspacing="0" cellpadding="0" border="0"> <tr> <td> <span class="c2">Medicīniskais laika tips 2<br> Saulains, bez mākoņiem<br> 0…+7 °C<br> Z vējš 2 - 4 m/s</span></td> <td><img src="design/saule_makonis.gif" border="0"></td> </tr> </table> </td> </tr> </table> ir class top_tab1, peec kura vareetu viegli izdabuut aaraa informaaciju, bet kaa ? tiiri tehniski kaa tas notiek ? Link to comment Share on other sites More sharing options...
andrisp Posted September 12, 2005 Author Report Share Posted September 12, 2005 function callback($matches) { return 'Pa vidu ir teksts: ' .$matches[1]; } $result = preg_replace_callback('/<table class="top_tab1" width="100%" height="100" cellspacing="0" cellpadding="0" border="0">(.*)<\/table>/' , 'callback' ,$x); echo $result; kautkur ieprieksheejos topicos atradu shitaadu veidu kaa ekstrakteet informaaciju no html (tipa $x ir viss lapas kods), bet nezkaapeec vinjs vienalga izdod pilniigi visu kodu.. kautkas nav ar regexpiem ? Link to comment Share on other sites More sharing options...
Delfins Posted September 12, 2005 Report Share Posted September 12, 2005 Oooou my god!!!! <H4 align=center><STRONG>3 - 7 m/s</STRONG></STRONG></STRONG></STRONG></STRONG></STRONG></STRONG></STRONG><STRONG><STRONG> </STRONG></STRONG></H4></H4></H4></H4></H4></H4></H4></H4></STRONG></H4></STRONG></H4></STRONG></H4></STRONG></H4></STRONG></H4></STRONG></H4></STRONG></H4></STRONG></H4></STRONG></H4></STRONG></H4></STRONG></H4></STRONG></H4></STRONG></H4></STRONG></H4></STRONG></H4></STRONG></H4></STRONG></H4></STRONG></H4></STRONG></H4></STRONG></H4></STRONG></H4></STRONG></H4></STRONG></H4></STRONG></H4></STRONG></H4></STRONG></H4></STRONG></H4></STRONG></STRONG></H4></H4></TD></TR></TBODY></TABLE> šausmas Link to comment Share on other sites More sharing options...
Robis Posted September 12, 2005 Report Share Posted September 12, 2005 Tiešām tici laika ziņām no meteo?? Pateikšu priekšā - NO LATVIJAS NORMĀLAS LAIKA ZIŅAS NENĀK (vismaz pa brīvu)! Kāpēc tā - nu mums tie metereologi ir pilnīgi zarazas un pa brīvu viņi tok neko nedod. Pie tam, ļoti daudz ir visādi viltus metereologi, kas patiesībā neko nerubī, tika vāra naudu! Pareizas Laika ziņas Latvijai, ieskaitot atsevišķus rajonus ir jāmeklē kaut kur ārzemju, amerikāņu internetā... Link to comment Share on other sites More sharing options...
andrisp Posted September 12, 2005 Author Report Share Posted September 12, 2005 Tiešām tici laika ziņām no meteo?? tieshaam nezinu, pirmo reizi kautko skatos saistiibaa ar laika zinjaam.. neesmu neko iipashi peetiijis.. Link to comment Share on other sites More sharing options...
Robis Posted September 12, 2005 Report Share Posted September 12, 2005 Nu, piem, paskaties te: http://www.wetteronline.de/cgi-bin/regfram...O=26406&LANG=de īsti nezinu, bet precīzāk varētu būt kā meteo Link to comment Share on other sites More sharing options...
andrisp Posted September 12, 2005 Author Report Share Posted September 12, 2005 ok, tas taa, bet kaapeec nestraadaa tas php, ko ja nemaldos Delfins bija kautkur ieposteejis ? Link to comment Share on other sites More sharing options...
bubu Posted September 12, 2005 Report Share Posted September 12, 2005 (edited) Tāpēc ka < un > ir jāeskeipo ar \ ne? Edited September 12, 2005 by bubu Link to comment Share on other sites More sharing options...
andrisp Posted September 12, 2005 Author Report Share Posted September 12, 2005 taapat neiet Link to comment Share on other sites More sharing options...
Gacha Posted September 12, 2005 Report Share Posted September 12, 2005 (edited) Redzkur vēl labāks veids - RSS priekš Rīgas. edit: Tur vēl var uztaisīt "custom RSS", iespēja mainīt dažus noderīgus parametrus. Edited September 12, 2005 by Gacha Link to comment Share on other sites More sharing options...
bubu Posted September 12, 2005 Report Share Posted September 12, 2005 Ah, tur vēl vajag s modifieri, lai .* arī \n uzskaitītu pie sevis Link to comment Share on other sites More sharing options...
Delfins Posted September 12, 2005 Report Share Posted September 12, 2005 Tāpēc ka < un > ir jāeskeipo ar \ ne? 22134[/snapback] kopš kura laika < un > jāeskeipo? Link to comment Share on other sites More sharing options...
andrisp Posted September 12, 2005 Author Report Share Posted September 12, 2005 Delfin, varbuut tu vari paliidzeet ar skriptu, kas izgriezh informaaciju no http://www.va.lv/musu/ ? Link to comment Share on other sites More sharing options...
Delfins Posted September 12, 2005 Report Share Posted September 12, 2005 (edited) Lūdzu, <?php $sp = '/<td><table width="100%" height="100%" cellspacing=0 cellpadding=0 border=0>\s*<tr>\s*<td> (.*?)<\/tr>\s*<\/table>\s*<\/td>/ism'; $data = file_get_contents('vidzeme.htm'); preg_match( $sp, $data, $m ); print( trim($m[1]) ); ?> Подсказка: Līkais va.lv koderis nez kāpēc PADDING taisa ar :) <td> Edited September 12, 2005 by Delfins Link to comment Share on other sites More sharing options...
Recommended Posts