cliv Posted April 18, 2017 Report Share Posted April 18, 2017 Nu sunt programator de php...insa acum ceva timp am incropit un script cu care preluam feed-ul RSS de pe agerpress de la adresa: Agerpress RSS ... acum s-a schimbat ceva si nu mai functioneaza. Poate ma ajuta cineva. Codul este urmatorul: <?php setlocale(LC_ALL, array('ro_RO.ISO8859-1', 'ro_RO.ISO-8859-1', 'ro', 'ro_RO', 'rom', 'romanian')); $xml=simplexml_load_file("https://www.agerpres.ro/home.rss"); $cnt = count($xml->channel->item); $count = 10; //Numarul de stiri afisate for($i=0; $i<$cnt; $i++) { $url = $xml->channel->item[$i]->link; $titlu = $xml->channel->item[$i]->title; $data = $xml->channel->item[$i]->pubDate; $imagine = $xml->channel->item[$i]->description->img->_src; $content = $xml->channel->item[$i]->description->__text; if($count > 0){ $date = date('d.m.Y - H:i', strtotime($data)); echo '<div>'; echo '<div>'; echo '<img src='.$imagine.' alt="">'; echo '</div>'; echo '<h4><a>'.$titlu.'</a></h4>'; echo '<div>'; echo '<span>publicat la '.$date.'</span>'; echo '</div>'; echo '<p>'.$content.'</p>'; echo '<a href="'.$url.'" >Citeşte</a>'; echo '</div>'; } $count--; } ?> Multumesc... Quote Link to comment Share on other sites More sharing options...
Guest Posted April 18, 2017 Report Share Posted April 18, 2017 (edited) Merge si acum, doar ca te-a blocat (le-ai omorat serverul cu requesturi inutile). Macar un cache la 5 minute de puneai... Edited April 18, 2017 by Guest Quote Link to comment Share on other sites More sharing options...
cliv Posted April 18, 2017 Author Report Share Posted April 18, 2017 Merci... Quote Link to comment Share on other sites More sharing options...
UnixDevel Posted April 18, 2017 Report Share Posted April 18, 2017 ai putea sa faci chestia asta asta cu javascript , si cand intra userul sa faci request in numele lui si dupa sa ai un ajax catre trimita raspunsul la tine in server si dupa o verificare daca ai articolul sau nu in db Quote Link to comment Share on other sites More sharing options...
Active Members dancezar Posted April 18, 2017 Active Members Report Share Posted April 18, 2017 (edited) 1 hour ago, n3curatu said: ai putea sa faci chestia asta asta cu javascript , si cand intra userul sa faci request in numele lui si dupa sa ai un ajax catre trimita raspunsul la tine in server si dupa o verificare daca ai articolul sau nu in db Same Origin Policy Edited April 18, 2017 by dancezar 2 Quote Link to comment Share on other sites More sharing options...
UnixDevel Posted April 19, 2017 Report Share Posted April 19, 2017 sau asta https://rss2json.com/docs Quote Link to comment Share on other sites More sharing options...