Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- ini_set ('display_errors', 1);
- error_reporting (E_ALL);
- function sort_help($a, $b) {
- global $veld;
- return strcmp ($a[$veld],$b[$veld]);
- }
- function importXmlFeeds()
- {
- $xmlFeeds = array(
- 'monsterboard' => 'http://rss.jobsearch.monster.com/rssquery.ashx?q=HR&rad_units=km&cy=nl&pp=15&sort=rv.di.dt&baseurl=vacature.monsterboard.nl',
- 'jobtrack' => 'http://www.jobtrack.nl/jobtrack/RSSSearchFeed.axd?fcategory=&kword=HR&workh=&elevel=®ion=&comp=&branche=&isforeign=&zipcode=&city=&joa=',
- 'NationaleVacatureBank' => 'http://www.nationalevacaturebank.nl/werknemer/vacature/zoekresultaat.xml?functiegroep=57&postcode_center=5051&trefwoord=HR',
- );
- $feedMessages = array();
- foreach ($xmlFeeds as $feed) {
- $feedMessages = array_merge($feedMessages, getXmlFeed($feed));
- }
- // print_r($feedMessages);
- if (is_array($feedMessages)) {
- echo '<pre>' . print_r($feedMessages, true) . '</pre>';
- $veld = 'pubDate';
- usort($feedMessages, "sort_help"); //hier sorteren we
- echo '<pre>' . print_r($feedMessages, true) . '</pre>';
- //$feedMessages = sortmulti($feedMessages, 'pubDate');
- //$feedMessages = makeHTML($feedMessages);
- }
- }
- function getXmlFeed($feed)
- {
- $tryOldWay = false;
- $xml = simplexml_load_file($feed,"SimpleXMLElement",LIBXML_NOCDATA);
- $arr = array();
- foreach($xml->channel->item as $key => $val) {
- $val = (array) $val;
- $arr[] = array(
- 'title' => $val['title'],
- 'description' => $val['description'],
- 'link' => $val['link'],
- 'pubDate' => date('Y-m-d',strtotime($val['pubDate'])),
- );
- }
- return $arr;
- }
- importXmlFeeds();
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement