Pop\Feed\Reader::getByUrl PHP Method

getByUrl() public static method

Static method to create a Feed Reader object from a URL
public static getByUrl ( string $url, integer $limit, string $prefix = 'Pop\Feed\Format\' ) : Reader
$url string
$limit integer
$prefix string
return Reader
    public static function getByUrl($url, $limit = 0, $prefix = 'Pop\\Feed\\Format\\')
    {
        $options = self::getSource($url);
        $class = class_exists($prefix . $options['format'] . '\\' . $options['service']) ? $prefix . $options['format'] . '\\' . $options['service'] : $prefix . $options['format'];
        return new self(new $class($options, $limit));
    }

Usage Example

Ejemplo n.º 1
0
 public function testSetAndGetDateFormat()
 {
     $feed = Feed\Reader::getByUrl('http://gdata.youtube.com/feeds/base/standardfeeds/most_viewed', 4);
     $feed->setDateFormat('m/d/Y');
     $this->assertEquals('m/d/Y', $feed->getDateFormat());
 }
All Usage Examples Of Pop\Feed\Reader::getByUrl