0

I'm currently working on a new backpacker trip portal. My idea is to load specific trip warnings from the official governement site on my site. I am allowed to use their official information due to german laws. But the point is, that they change their content on a daily to hourly basis, so copy & paste is no solution. I already tried getting their content via jQuery, but cross-domain-policy came across and as you can imagine I have no control over their server ;-) While searching for a solution I came across cURL in PHP. From here on I need your help, because I can only wright some few small functions. I thought maybe there is an option to fetch the content via cURL and then just display the divs I need or to use their rss feed and fetch the information from there? Any help or hints are appreciated :-)

Website: http://www.auswaertiges-amt.de/DE/Laenderinformationen/WeitereAktuelleReiseInformationen_node.html xml-based rss feed: http://www.auswaertiges-amt.de/SiteGlobals/Functions/RSSFeed/DE/RSSNewsfeed/RSS_Reisehinweise.xml?nn=332604

florian
  • 23
  • 2
  • 1
    You could use curl or fopen or file_get_contents...from there all you need is a way to parse the XML which, lucky for you, is quite easy in PHP: http://www.php.net/manual/en/book.xml.php – JasonSec May 14 '14 at 20:52
  • 1
    possible duplicate of [How do you parse and process HTML/XML in PHP?](http://stackoverflow.com/questions/3577641/how-do-you-parse-and-process-html-xml-in-php) – Paul Dessert May 14 '14 at 20:52

1 Answers1

-1

HTML Solution Simple html Dom is a library that permit use select DOM tag type jquery,

use like as

$html=file_get_html('http://www.auswaertigesamt.de/DE/Laenderinformationen/WeitereAktuelleReiseInormationen_node.html');

$note_text = $html->find("div[class=reiseUebersicht]", 0)->children(1)->plaintext;

I guess that HTML is a easy solution because your RSS(xml) is unlike a standard because it embed html , like as "<![CDATA[ ]]>"

Parse XML Solution use PHP Simple DOM, but you need parse HML DOM , for decode cdata

$doc = DOMDocument::load('http://www.example.com/file.xml');

Community
  • 1
  • 1
Adrian Romero
  • 537
  • 6
  • 13