Pop\Feed\Format\Rss\Flickr::parse PHP Метод

parse() публичный Метод

Method to parse a Flickr RSS feed object
public parse ( ) : void
Результат void
    public function parse()
    {
        parent::parse();
        if (null === $this->feed['author']) {
            $this->feed['author'] = str_replace('Uploads from ', '', $this->feed['title']);
        }
        if (null === $this->feed['date']) {
            $this->feed['date'] = date('D, d M Y H:i:s O');
        }
        if (null === $this->feed['generator']) {
            $this->feed['generator'] = 'Flickr';
        }
        $namespaces = $this->obj->getDocNamespaces(true);
        $items = $this->feed['items'];
        foreach ($items as $key => $item) {
            $entry = $this->obj->item[0];
            $dc = $entry->children($namespaces['dc']);
            $image = substr($item['content'], strpos($item['content'], '<img src="') + 10);
            $image = substr($image, 0, strpos($image, '"'));
            $items[$key]['published'] = (string) $dc->{'date.Taken'};
            $items[$key]['time'] = self::calculateTime($items[$key]['published']);
            $items[$key]['image_thumb'] = str_replace('_m', '_s', $image);
            $items[$key]['image_medium'] = $image;
            $items[$key]['image_large'] = str_replace('_m', '', $image);
            $items[$key]['image_orig'] = str_replace('_m', '_b', $image);
        }
        $this->feed['items'] = $items;
    }