add composer's vendor directory
This commit is contained in:
parent
01a3860d73
commit
60b094d5fa
745 changed files with 56017 additions and 1 deletions
23
vendor/fguillot/picofeed/lib/PicoFeed/Generator/ContentGeneratorInterface.php
vendored
Normal file
23
vendor/fguillot/picofeed/lib/PicoFeed/Generator/ContentGeneratorInterface.php
vendored
Normal file
|
@ -0,0 +1,23 @@
|
|||
<?php
|
||||
|
||||
namespace PicoFeed\Generator;
|
||||
|
||||
use PicoFeed\Parser\Item;
|
||||
|
||||
/**
|
||||
* Content Generator Interface
|
||||
*
|
||||
* @package PicoFeed\Generator
|
||||
* @author Frederic Guillot
|
||||
*/
|
||||
interface ContentGeneratorInterface
|
||||
{
|
||||
/**
|
||||
* Execute Content Generator
|
||||
*
|
||||
* @access public
|
||||
* @param Item $item
|
||||
* @return boolean
|
||||
*/
|
||||
public function execute(Item $item);
|
||||
}
|
36
vendor/fguillot/picofeed/lib/PicoFeed/Generator/FileContentGenerator.php
vendored
Normal file
36
vendor/fguillot/picofeed/lib/PicoFeed/Generator/FileContentGenerator.php
vendored
Normal file
|
@ -0,0 +1,36 @@
|
|||
<?php
|
||||
|
||||
namespace PicoFeed\Generator;
|
||||
|
||||
use PicoFeed\Base;
|
||||
use PicoFeed\Parser\Item;
|
||||
|
||||
/**
|
||||
* File Content Generator
|
||||
*
|
||||
* @package PicoFeed\Generator
|
||||
* @author Frederic Guillot
|
||||
*/
|
||||
class FileContentGenerator extends Base implements ContentGeneratorInterface
|
||||
{
|
||||
private $extensions = array('pdf');
|
||||
|
||||
/**
|
||||
* Execute Content Generator
|
||||
*
|
||||
* @access public
|
||||
* @param Item $item
|
||||
* @return boolean
|
||||
*/
|
||||
public function execute(Item $item)
|
||||
{
|
||||
foreach ($this->extensions as $extension) {
|
||||
if (substr($item->getUrl(), - strlen($extension)) === $extension) {
|
||||
$item->setContent('<a href="'.$item->getUrl().'" target="_blank">'.$item->getUrl().'</a>');
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
67
vendor/fguillot/picofeed/lib/PicoFeed/Generator/YoutubeContentGenerator.php
vendored
Normal file
67
vendor/fguillot/picofeed/lib/PicoFeed/Generator/YoutubeContentGenerator.php
vendored
Normal file
|
@ -0,0 +1,67 @@
|
|||
<?php
|
||||
|
||||
namespace PicoFeed\Generator;
|
||||
|
||||
use PicoFeed\Base;
|
||||
use PicoFeed\Parser\Item;
|
||||
|
||||
/**
|
||||
* Youtube Content Generator
|
||||
*
|
||||
* @package PicoFeed\Generator
|
||||
* @author Frederic Guillot
|
||||
*/
|
||||
class YoutubeContentGenerator extends Base implements ContentGeneratorInterface
|
||||
{
|
||||
/**
|
||||
* Execute Content Generator
|
||||
*
|
||||
* @access public
|
||||
* @param Item $item
|
||||
* @return boolean
|
||||
*/
|
||||
public function execute(Item $item)
|
||||
{
|
||||
if ($item->hasNamespace('yt')) {
|
||||
return $this->generateHtmlFromXml($item);
|
||||
}
|
||||
|
||||
return $this->generateHtmlFromUrl($item);
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate HTML
|
||||
*
|
||||
* @access public
|
||||
* @param Item $item
|
||||
* @return boolean
|
||||
*/
|
||||
private function generateHtmlFromXml(Item $item)
|
||||
{
|
||||
$videoId = $item->getTag('yt:videoId');
|
||||
|
||||
if (! empty($videoId)) {
|
||||
$item->setContent('<iframe width="560" height="315" src="//www.youtube.com/embed/'.$videoId[0].'" frameborder="0"></iframe>');
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate HTML from item URL
|
||||
*
|
||||
* @access public
|
||||
* @param Item $item
|
||||
* @return bool
|
||||
*/
|
||||
public function generateHtmlFromUrl(Item $item)
|
||||
{
|
||||
if (preg_match('/youtube\.com\/watch\?v=(.*)/', $item->getUrl(), $matches)) {
|
||||
$item->setContent('<iframe width="560" height="315" src="//www.youtube.com/embed/'.$matches[1].'" frameborder="0"></iframe>');
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
Reference in a new issue