示例#1
0
 public function run()
 {
     $feeds = ['https://hir.aviontego.com/portals/feeds/JobPositionHRXml.aspx?CompanyID=HC', 'https://webserv1.keyjobs.com/Avionte/Portals/feeds/JobPositionHRXml.aspx?CompanyID=KeyPersonnel', 'https://portals.peoplelinkstaffing.com/Avionte/portals/feeds/JobPositionHRXml.aspx?CompanyID=PPL', 'https://sop.aviontego.com/portals/feeds/JobPositionHRXml.aspx?CompanyID=SSS', 'https://portals.aviontego.com/AbundantSolutions/feeds/JobPositionHRXml.aspx?CompanyID=ABS', 'http://portal.standbypersonnel.com/portals/feeds/JobPositionHRXml.aspx?CompanyID=StandBy'];
     foreach ($feeds as $url) {
         $parsed = readFeed($url);
         FeedUrl::create(['publisher_name' => $parsed['PublisherInfo']['Name'], 'url' => $url]);
     }
 }
示例#2
0
/**
 * Get Publisher Names
 * 
 * @return array
 */
function getPublisherNames()
{
    $data = [];
    $feeds = \XFed\FeedUrl::keyValue();
    foreach ($feeds as $id => $url) {
        $parsed = readFeed($url);
        $data[$id] = $parsed['PublisherInfo']['Name'];
    }
    return $data;
}
示例#3
0
 public function storeJobs()
 {
     $feed = FeedUrl::find($this->request->input('XmlID'));
     $parsed = readFeed($feed->url);
     foreach ($parsed['PositionOpening'] as $row) {
         if ($row['PositionRecordInfo']['Id']['IdValue'] === $this->request->input('ID')) {
             if (isJobExist($this->request->input('ID')) < 1) {
                 storeJobRow($row);
                 exit;
             }
         }
     }
 }
示例#4
0
	/**
	 * key method that parses the XML API stream and converts to PHP
	 * has to be called with 1 argument: the ressource that should be evaluated
	 * e.g. "http://picasaweb.google.com/data/feed/api/user/USERNAME?kind=album"
	 */
	public function parseFeed($location) {

		require_once('feeder.php');
		$feed_arr = array(); //Array that contains all loaded and parsed Data
		$feedXml = readFeed($location, $this->options['cachelife'], $this->options['cachedir'], $this->options['proxy']);

		debugLog('Feed (' .$location .')');
		if (empty($feedXml)) {
			debugLog('pmGallery Error: Unable to retrieve feed (' .$location .')', true);
			return $feed_arr;
		}

		// parse the RSS Feed -- needs PHP5
		$feed = simplexml_load_string($feedXml);
		$namespace = $feed->getDocNamespaces();

		//Main user information
		$feed_arr['user']['name'] = (string)$feed->author->name;
		$feed_arr['user']['icon'] = (string)$feed->icon;
		$feed_arr['user']['id'] = (string)$feed->id;

		$i = 0;
		foreach ($feed->entry as $item) {
			$feed_arr['main'][$i]['id'] =(string) $item->id;
			$feed_arr['main'][$i]['title'] = (string)$item->title;
			$feed_arr['main'][$i]['src'] = (string)$item->content['src'];
			$feed_arr['main'][$i]['apiLink'] = (string)$item->link[0]['href'];
			$feed_arr['main'][$i]['published'] = (string)$item->published;
			$feed_arr['main'][$i]['updated'] = (string)$item->updated;
			$feed_arr['main'][$i]['summary'] = (string)$item->summary;
			$feed_arr['main'][$i]['rights'] = (string)$item->rights;
			$feed_arr['main'][$i]['author'] = (string)$item->author->name;
			$feed_arr['main'][$i]['authorLink'] = (string)$item->author->uri;

			//Gphoto namespace data
			$ns_gphoto=$item->children($namespace['gphoto']);
			$feed_arr['gphoto'][$i]['id'] = (string)$ns_gphoto->id;
			$feed_arr['gphoto'][$i]['name'] = (string)$ns_gphoto->name;
			$feed_arr['gphoto'][$i]['timestamp'] = (string)$ns_gphoto->timestamp/1000;
			$feed_arr['gphoto'][$i]['albumid'] = (string)$ns_gphoto->id;
			$feed_arr['gphoto'][$i]['numphotos'] = (string)$ns_gphoto->numphotos;
			$feed_arr['gphoto'][$i]['commentingEnabled'] = (string)$ns_gphoto->commentingEnabled;
			$feed_arr['gphoto'][$i]['commentCount'] = (string)$ns_gphoto->commentCount;
			$feed_arr['gphoto'][$i]['location'] = (string)$ns_gphoto->location;
			$feed_arr['gphoto'][$i]['height'] = (string)$ns_gphoto->height;
			$feed_arr['gphoto'][$i]['width'] = (string)$ns_gphoto->width;

			//Media namespace data
			$ns_media=$item->children($namespace['media']);
			$feed_arr['entry'][$i]['id'] = (string)$ns_gphoto->id;
			$feed_arr['entry'][$i]['title'] = (string)$ns_media->group->title;
			$feed_arr['entry'][$i]['description'] = (string)$ns_media->group->description;
			$feed_arr['entry'][$i]['keywords'] = (string)$ns_media->group->keywords;

			$thumb_attr = $ns_media->group->thumbnail->attributes();
			$feed_arr['entry'][$i]['thumbnail_w'] = (int)$thumb_attr['width'];
			$feed_arr['entry'][$i]['thumbnail_h'] = (int)$thumb_attr['height'];

			$con_attr = $ns_media->group->content->attributes();
			$feed_arr['entry'][$i]['url'] = (string)$con_attr['url'];
			$feed_arr['entry'][$i]['width'] = (string)$con_attr['width'];
			$feed_arr['entry'][$i]['height'] = (string)$con_attr['height'];
			$feed_arr['entry'][$i]['type'] = (string)$con_attr['type'];

			//Exif namespace data
			$exif=$item->children($namespace['exif'])->tags;
			$feed_arr['exif'][$i]['distance'] = (string)$exif->distance;
			$feed_arr['exif'][$i]['exposure'] = (string)$exif->exposure;  //"1/" + (int)(1 / value + 0.5);
			$feed_arr['exif'][$i]['flash'] = (string)$exif->flash;
			$feed_arr['exif'][$i]['focallength'] = (string)$exif->focallength;
			$feed_arr['exif'][$i]['fstop'] = (string)$exif->fstop;
			$feed_arr['exif'][$i]['imageUniqueID'] = (string)$exif->imageUniqueID;
			$feed_arr['exif'][$i]['iso'] = (string)$exif->iso;
			$feed_arr['exif'][$i]['make'] = (string)$exif->make;
			$feed_arr['exif'][$i]['model'] = (string)$exif->model;
			$feed_arr['exif'][$i]['tags'] = (string)$exif->tags;
			$feed_arr['exif'][$i]['timestamp'] = (string)$exif->time;

			$feed_arr['main'][$i]['thumbSrc'] = $this->getThumbnailUrl($feed_arr['entry'][$i]['url'], $this->options['thumbsize']);
			$feed_arr['main'][$i]['largeSrc'] = $this->getThumbnailUrl($feed_arr['entry'][$i]['url'], $this->options['imagesize']);

			$i++;
		}
		return $feed_arr;
	}