Voici une nouvelle contribution à RSS-Bridge, officieuse cette fois-ci, à savoir le site de cosplay Geek x Girls :
<?php
/**
* RssBridgeGeekxGirls
* Returns the newest interesting images from http://www.geekxgirls.com
*
* @name Geek x Girls
* @description Returns the latest interesting images from Geek x Girls
*/
class GeekxGirlsBridge extends BridgeAbstract
{
public function collectData(array $param) {
$link = 'http://www.geekxgirls.com/';
$html = file_get_html($link) or $this->returnError('Could not request Geek x Girls.', 404);
foreach( $html->find('div') as $element ) {
if ( $element->getAttribute('id') == 'contentpost' ) {
$item = new \Item();
$item->uri = $link.$element->find('a',0)->href;
$item->thumbnailUri = $element->find('img',0)->getAttribute('src');
$item->content = '<a href="'.$item->uri.'"><img src=".$link.$item->thumbnailUri.'></a>';
$item->title = $element->find('h4',0)->find('center',0)->plaintext;
$this->items[] = $item;
}
}
}
public function getName() {
return 'Geek x Girls';
}
public function getURI() {
return 'http://www.geekxgirls.com/';
}
public function getCacheDuration() {
return 21600; // 6 hours
}
}