1
0
Fork 0
forked from blallo/rss-bridge

Merge branch 'methods2functions' of https://framagit.org/peetah/rss-bridge

This commit is contained in:
logmanoriginal 2016-10-02 16:05:58 +02:00
commit 970e216c1f
114 changed files with 899 additions and 904 deletions

View file

@ -8,7 +8,7 @@ class ABCTabsBridge extends BridgeAbstract{
public function collectData(){
$html = '';
$html = $this->getSimpleHTMLDOM(static::URI.'tablatures/nouveautes.html') or $this->returnClientError('No results for this query.');
$html = getSimpleHTMLDOM(static::URI.'tablatures/nouveautes.html') or returnClientError('No results for this query.');
$table = $html->find('table#myTable', 0)->children(1);
foreach ($table->find('tr') as $tab)

View file

@ -14,10 +14,9 @@ class AcrimedBridge extends FeedExpander {
protected function parseItem($newsItem){
$item = parent::parseItem($newsItem);
$hs = new HTMLSanitizer();
$articlePage = $this->getSimpleHTMLDOM($newsItem->link);
$article = $hs->sanitize($articlePage->find('article.article1', 0)->innertext);
$article = HTMLSanitizer::defaultImageSrcTo($article, static::URI);
$articlePage = getSimpleHTMLDOM($newsItem->link);
$article = sanitize($articlePage->find('article.article1', 0)->innertext);
$article = defaultImageSrcTo($article, static::URI);
$item['content'] = $article;
return $item;

View file

@ -48,8 +48,8 @@ class AllocineFRBridge extends BridgeAbstract{
public function collectData(){
$html = $this->getSimpleHTMLDOM($this->getURI())
or $this->returnServerError("Could not request ".$this->getURI()." !");
$html = getSimpleHTMLDOM($this->getURI())
or returnServerError("Could not request ".$this->getURI()." !");
$category=array_search(
$this->getInput('category'),

View file

@ -39,8 +39,8 @@ class AnimeUltimeBridge extends BridgeAbstract {
//Retrive page contents
$url = self::URI.'history-0-1/'.$requestFilter;
$html = $this->getSimpleHTMLDOM($url)
or $this->returnServerError('Could not request Anime-Ultime: '.$url);
$html = getSimpleHTMLDOM($url)
or returnServerError('Could not request Anime-Ultime: '.$url);
//Relases are sorted by day : process each day individually
foreach ($html->find('div.history', 0)->find('h3') as $daySection) {
@ -68,8 +68,8 @@ class AnimeUltimeBridge extends BridgeAbstract {
if (!empty($item_uri)) {
//Retrieve description from description page and convert relative image src info absolute image src
$html_item = $this->getContents($item_uri)
or $this->returnServerError('Could not request Anime-Ultime: '.$item_uri);
$html_item = getContents($item_uri)
or returnServerError('Could not request Anime-Ultime: '.$item_uri);
$item_description = substr(
$html_item,
strpos($html_item, 'class="principal_contain" align="center">')

View file

@ -58,7 +58,7 @@
}
$url = self::URI.'guide/'.$lang.'/plus7/'.$category;
$input = $this->getContents($url) or die('Could not request ARTE.');
$input = getContents($url) or die('Could not request ARTE.');
if(strpos($input, 'categoryVideoSet') !== FALSE){
$input = explode('categoryVideoSet: ', $input);
$input = explode('}},', $input[1]);

View file

@ -16,8 +16,8 @@ class AskfmBridge extends BridgeAbstract{
);
public function collectData(){
$html = $this->getSimpleHTMLDOM($this->getURI())
or $this->returnServerError('Requested username can\'t be found.');
$html = getSimpleHTMLDOM($this->getURI())
or returnServerError('Requested username can\'t be found.');
foreach($html->find('div.streamItem-answer') as $element) {
$item = array();

View file

@ -15,8 +15,8 @@ class BandcampBridge extends BridgeAbstract{
));
public function collectData(){
$html = $this->getSimpleHTMLDOM($this->getURI())
or $this->returnServerError('No results for this query.');
$html = getSimpleHTMLDOM($this->getURI())
or returnServerError('No results for this query.');
foreach($html->find('li.item') as $release) {
$script = $release->find('div.art', 0)->getAttribute('onclick');

View file

@ -12,8 +12,8 @@ class BastaBridge extends BridgeAbstract{
return preg_replace('/src=["\']{1}([^"\']+)/ims', 'src=\''.self::URI.'$1\'', $content);
}
$html = $this->getSimpleHTMLDOM(self::URI.'spip.php?page=backend')
or $this->returnServerError('Could not request Bastamag.');
$html = getSimpleHTMLDOM(self::URI.'spip.php?page=backend')
or returnServerError('Could not request Bastamag.');
$limit = 0;
foreach($html->find('item') as $element) {
@ -22,7 +22,7 @@ class BastaBridge extends BridgeAbstract{
$item['title'] = $element->find('title', 0)->innertext;
$item['uri'] = $element->find('guid', 0)->plaintext;
$item['timestamp'] = strtotime($element->find('dc:date', 0)->plaintext);
$item['content'] = ReplaceImageUrl($this->getSimpleHTMLDOM($item['uri'])->find('div.texte', 0)->innertext);
$item['content'] = ReplaceImageUrl(getSimpleHTMLDOM($item['uri'])->find('div.texte', 0)->innertext);
$this->items[] = $item;
$limit++;
}

View file

@ -9,8 +9,8 @@ class BlaguesDeMerdeBridge extends BridgeAbstract{
public function collectData(){
$html = $this->getSimpleHTMLDOM(self::URI)
or $this->returnServerError('Could not request BDM.');
$html = getSimpleHTMLDOM(self::URI)
or returnServerError('Could not request BDM.');
foreach($html->find('article.joke_contener') as $element) {
$item = array();

View file

@ -17,7 +17,7 @@ class CADBridge extends FeedExpander {
}
private function CADExtractContent($url) {
$html3 = $this->getSimpleHTMLDOMCached($url);
$html3 = getSimpleHTMLDOMCached($url);
// The request might fail due to missing https support or wrong URL
if($html3 == false)

View file

@ -39,7 +39,7 @@ class CNETBridge extends BridgeAbstract {
}
$pageUrl = self::URI.(empty($this->getInput('topic')) ? '' : 'topics/'.$this->getInput('topic').'/');
$html = $this->getSimpleHTMLDOM($pageUrl) or $this->returnServerError('Could not request CNET: '.$pageUrl);
$html = getSimpleHTMLDOM($pageUrl) or returnServerError('Could not request CNET: '.$pageUrl);
$limit = 0;
foreach($html->find('div.assetBody') as $element) {
@ -52,7 +52,7 @@ class CNETBridge extends BridgeAbstract {
if (!empty($article_title) && !empty($article_uri) && strpos($article_uri, '/news/') !== false) {
$article_html = $this->getSimpleHTMLDOM($article_uri) or $this->returnServerError('Could not request CNET: '.$article_uri);
$article_html = getSimpleHTMLDOM($article_uri) or returnServerError('Could not request CNET: '.$article_uri);
$article_content = trim(CleanArticle(ExtractFromDelimiters($article_html, '<div class="articleContent', '<footer>')));

View file

@ -33,7 +33,7 @@ class CastorusBridge extends BridgeAbstract {
$title = $activity->find('a', 0);
if(!$title)
$this->returnServerError('Cannot find title!');
returnServerError('Cannot find title!');
return htmlspecialchars(trim($title->plaintext));
}
@ -43,7 +43,7 @@ class CastorusBridge extends BridgeAbstract {
$url = $activity->find('a', 0);
if(!$url)
$this->returnServerError('Cannot find url!');
returnServerError('Cannot find url!');
return self::URI . $url->href;
}
@ -55,7 +55,7 @@ class CastorusBridge extends BridgeAbstract {
$nodes = $activity->find('*');
if(!$nodes)
$this->returnServerError('Cannot find nodes!');
returnServerError('Cannot find nodes!');
foreach($nodes as $node){
$node->outertext = '';
@ -69,7 +69,7 @@ class CastorusBridge extends BridgeAbstract {
$price = $activity->find('span', 1);
if(!$price)
$this->returnServerError('Cannot find price!');
returnServerError('Cannot find price!');
return $price->innertext;
}
@ -78,15 +78,15 @@ class CastorusBridge extends BridgeAbstract {
$zip_filter = trim($this->getInput('zip'));
$city_filter = trim($this->getInput('city'));
$html = $this->getSimpleHTMLDOM(self::URI);
$html = getSimpleHTMLDOM(self::URI);
if(!$html)
$this->returnServerError('Could not load data from ' . self::URI . '!');
returnServerError('Could not load data from ' . self::URI . '!');
$activities = $html->find('div#activite/li');
if(!$activities)
$this->returnServerError('Failed to find activities!');
returnServerError('Failed to find activities!');
foreach($activities as $activity){
$item = array();

View file

@ -31,8 +31,8 @@ class CollegeDeFranceBridge extends BridgeAbstract{
* </a>
* </li>
*/
$html = $this->getSimpleHTMLDOM(self::URI.'components/search-audiovideo.jsp?fulltext=&siteid=1156951719600&lang=FR&type=all')
or $this->returnServerError('Could not request CollegeDeFrance.');
$html = getSimpleHTMLDOM(self::URI.'components/search-audiovideo.jsp?fulltext=&siteid=1156951719600&lang=FR&type=all')
or returnServerError('Could not request CollegeDeFrance.');
foreach($html->find('a[data-target]') as $element) {
$item = array();
$item['title'] = $element->find('.title', 0)->plaintext;

View file

@ -17,7 +17,7 @@ class CommonDreamsBridge extends FeedExpander {
}
private function CommonDreamsExtractContent($url) {
$html3 = $this->getSimpleHTMLDOMCached($url);
$html3 = getSimpleHTMLDOMCached($url);
$text = $html3->find('div[class=field--type-text-with-summary]', 0)->innertext;
$html3->clear();
unset ($html3);

View file

@ -8,8 +8,8 @@ class CopieDoubleBridge extends BridgeAbstract{
const DESCRIPTION = "CopieDouble";
public function collectData(){
$html = $this->getSimpleHTMLDOM(self::URI)
or $this->returnServerError('Could not request CopieDouble.');
$html = getSimpleHTMLDOM(self::URI)
or returnServerError('Could not request CopieDouble.');
$table = $html->find('table table', 2);
foreach($table->find('tr') as $element)

View file

@ -9,8 +9,8 @@ class CourrierInternationalBridge extends BridgeAbstract{
public function collectData(){
$html = $this->getSimpleHTMLDOM(self::URI)
or $this->returnServerError('Error.');
$html = getSimpleHTMLDOM(self::URI)
or returnServerError('Error.');
$element = $html->find("article");
@ -26,11 +26,9 @@ class CourrierInternationalBridge extends BridgeAbstract{
$item['uri'] = self::URI.$item['uri'];
}
$page = $this->getSimpleHTMLDOM($item['uri']);
$page = getSimpleHTMLDOM($item['uri']);
$cleaner = new HTMLSanitizer();
$item['content'] = $cleaner->sanitize($page->find("div.article-text")[0]);
$item['content'] = sanitize($page->find("div.article-text")[0]);
$item['title'] = strip_tags($article->find(".title")[0]);
$dateTime = date_parse($page->find("time")[0]);

View file

@ -17,14 +17,14 @@ class CpasbienBridge extends BridgeAbstract {
public function collectData(){
$request = str_replace(" ","-",trim($this->getInput('q')));
$html = $this->getSimpleHTMLDOM(self::URI.'/recherche/'.urlencode($request).'.html')
or $this->returnServerError('No results for this query.');
$html = getSimpleHTMLDOM(self::URI.'/recherche/'.urlencode($request).'.html')
or returnServerError('No results for this query.');
foreach ($html->find('#gauche',0)->find('div') as $episode) {
if ($episode->getAttribute('class')=='ligne0' ||
$episode->getAttribute('class')=='ligne1')
{
$htmlepisode=$this->getSimpleHTMLDOMCached($episode->find('a', 0)->getAttribute('href'));
$htmlepisode=getSimpleHTMLDOMCached($episode->find('a', 0)->getAttribute('href'));
$item = array();
$item['author'] = $episode->find('a', 0)->text();

View file

@ -17,8 +17,8 @@ class CryptomeBridge extends BridgeAbstract{
));
public function collectData(){
$html = $this->getSimpleHTMLDOM(self::URI)
or $this->returnServerError('Could not request Cryptome.');
$html = getSimpleHTMLDOM(self::URI)
or returnServerError('Could not request Cryptome.');
$number=$this->getInput('n');
if (!empty($number)) { /* number of documents */
$num = min($number, 20);

View file

@ -36,7 +36,7 @@ class DailymotionBridge extends BridgeAbstract{
function getMetadata($id) {
$metadata=array();
$html2 = $this->getSimpleHTMLDOM(self::URI.'video/'.$id);
$html2 = getSimpleHTMLDOM(self::URI.'video/'.$id);
if(!$html2){
return $metadata;
}
@ -53,8 +53,8 @@ class DailymotionBridge extends BridgeAbstract{
$limit = 5;
$count = 0;
$html = $this->getSimpleHTMLDOM($this->getURI())
or $this->returnServerError('Could not request Dailymotion.');
$html = getSimpleHTMLDOM($this->getURI())
or returnServerError('Could not request Dailymotion.');
foreach($html->find('div.media a.preview_link') as $element) {
if($count < $limit) {

View file

@ -41,8 +41,8 @@ class DanbooruBridge extends BridgeAbstract{
}
public function collectData(){
$html = $this->getSimpleHTMLDOM($this->getFullURI())
or $this->returnServerError('Could not request '.$this->getName());
$html = getSimpleHTMLDOM($this->getFullURI())
or returnServerError('Could not request '.$this->getName());
foreach($html->find(static::PATHTODATA) as $element) {
$this->items[] = $this->getItemFromElement($element);

View file

@ -9,8 +9,8 @@ class DansTonChatBridge extends BridgeAbstract{
public function collectData(){
$html = $this->getSimpleHTMLDOM(self::URI.'latest.html')
or $this->returnServerError('Could not request DansTonChat.');
$html = getSimpleHTMLDOM(self::URI.'latest.html')
or returnServerError('Could not request DansTonChat.');
foreach($html->find('div.item') as $element) {
$item = array();

View file

@ -48,7 +48,7 @@ class DauphineLibereBridge extends FeedExpander {
}
private function ExtractContent($url) {
$html2 = $this->getSimpleHTMLDOMCached($url);
$html2 = getSimpleHTMLDOMCached($url);
$text = $html2->find('div.column', 0)->innertext;
$text = preg_replace('@<script[^>]*?>.*?</script>@si', '', $text);
return $text;

View file

@ -43,7 +43,7 @@ class DeveloppezDotComBridge extends FeedExpander {
}
private function DeveloppezDotComExtractContent($url) {
$articleHTMLContent = $this->getSimpleHTMLDOMCached($url);
$articleHTMLContent = getSimpleHTMLDOMCached($url);
$text = $this->convert_smart_quotes($articleHTMLContent->find('div.content', 0)->innertext);
$text = utf8_encode($text);
return trim($text);

View file

@ -9,7 +9,7 @@ class DilbertBridge extends BridgeAbstract {
public function collectData(){
$html = $this->getSimpleHTMLDOM($this->getURI()) or $this->returnServerError('Could not request Dilbert: '.$this->getURI());
$html = getSimpleHTMLDOM($this->getURI()) or returnServerError('Could not request Dilbert: '.$this->getURI());
foreach ($html->find('section.comic-item') as $element) {

View file

@ -14,8 +14,8 @@ class DuckDuckGoBridge extends BridgeAbstract{
));
public function collectData(){
$html = $this->getSimpleHTMLDOM(self::URI.'html/?q='.$this->getInput('u').'+sort:date')
or $this->returnServerError('Could not request DuckDuckGo.');
$html = getSimpleHTMLDOM(self::URI.'html/?q='.$this->getInput('u').'+sort:date')
or returnServerError('Could not request DuckDuckGo.');
foreach($html->find('div.results_links') as $element) {
$item = array();

View file

@ -34,8 +34,8 @@ class EZTVBridge extends BridgeAbstract{
foreach($showList as $showID){
// Get show page
$html = $this->getSimpleHTMLDOM(self::URI.'shows/'.rawurlencode($showID).'/')
or $this->returnServerError('Could not request EZTV for id "'.$showID.'"');
$html = getSimpleHTMLDOM(self::URI.'shows/'.rawurlencode($showID).'/')
or returnServerError('Could not request EZTV for id "'.$showID.'"');
// Loop on each element that look like an episode entry...
foreach($html->find('.forum_header_border') as $element) {

View file

@ -9,8 +9,8 @@ class EliteDangerousGalnetBridge extends BridgeAbstract
public function collectData()
{
$html = $this->getSimpleHTMLDOM(self::URI)
or $this->returnServerError('Error while downloading the website content');
$html = getSimpleHTMLDOM(self::URI)
or returnServerError('Error while downloading the website content');
foreach($html->find('div.article') as $element) {
$item = array();

View file

@ -58,7 +58,7 @@ class ElsevierBridge extends BridgeAbstract{
public function collectData(){
$uri = self::URI . $this->getInput('j') . '/recent-articles/';
$html = $this->getSimpleHTMLDOM($uri) or $this->returnServerError('No results for Elsevier journal '.$this->getInput('j'));
$html = getSimpleHTMLDOM($uri) or returnServerError('No results for Elsevier journal '.$this->getInput('j'));
foreach($html->find('.pod-listing') as $article){
$item = array();

View file

@ -16,7 +16,7 @@ class EstCeQuonMetEnProdBridge extends BridgeAbstract {
} return false;
}
$html = $this->getSimpleHTMLDOM($this->getURI()) or $this->returnServerError('Could not request EstCeQuonMetEnProd: '.$this->getURI());
$html = getSimpleHTMLDOM($this->getURI()) or returnServerError('Could not request EstCeQuonMetEnProd: '.$this->getURI());
$item = array();
$item['uri'] = $this->getURI().'#'.date('Y-m-d');

View file

@ -93,8 +93,8 @@ class FacebookBridge extends BridgeAbstract{
),
);
$context = stream_context_create($http_options);
$html = $this->getContents($captcha_action, false, $context);
if ($html === FALSE) { $this->returnServerError('Failed to submit captcha response back to Facebook'); }
$html = getContents($captcha_action, false, $context);
if ($html === FALSE) { returnServerError('Failed to submit captcha response back to Facebook'); }
unset($_SESSION['captcha_fields']);
$html = str_get_html($html);
}
@ -105,11 +105,11 @@ class FacebookBridge extends BridgeAbstract{
//Retrieve page contents
if (is_null($html)) {
if (!strpos($this->getInput('u'), "/")) {
$html = $this->getSimpleHTMLDOM(self::URI.urlencode($this->getInput('u')).'?_fb_noscript=1')
or $this->returnServerError('No results for this query.');
$html = getSimpleHTMLDOM(self::URI.urlencode($this->getInput('u')).'?_fb_noscript=1')
or returnServerError('No results for this query.');
} else {
$html = $this->getSimpleHTMLDOM(self::URI.'pages/'.$this->getInput('u').'?_fb_noscript=1')
or $this->returnServerError('No results for this query.');
$html = getSimpleHTMLDOM(self::URI.'pages/'.$this->getInput('u').'?_fb_noscript=1')
or returnServerError('No results for this query.');
}
}
@ -127,7 +127,7 @@ class FacebookBridge extends BridgeAbstract{
$_SESSION['captcha_action'] = self::URI.$captcha->find('form', 0)->action;
//Show captcha filling form to the viewer, proxying the captcha image
$img = base64_encode($this->getContents($captcha->find('img', 0)->src));
$img = base64_encode(getContents($captcha->find('img', 0)->src));
header('HTTP/1.1 500 '.Http::getMessageForCode(500));
header('Content-Type: text/html');
die('<form method="post" action="?'.$_SERVER['QUERY_STRING'].'">'

View file

@ -38,7 +38,7 @@ class FeedExpanderExampleBridge extends FeedExpander {
case 'atom_1_0':
parent::collectExpandableDatas('http://segfault.linuxmint.com/feed/atom/');
break;
default: $this->returnClientError('Unknown version ' . $this->getInput('version') . '!');
default: returnClientError('Unknown version ' . $this->getInput('version') . '!');
}
}
@ -56,7 +56,7 @@ class FeedExpanderExampleBridge extends FeedExpander {
case 'atom_1_0':
return $this->parseATOMItem($newsItem);
break;
default: $this->returnClientError('Unknown version ' . $this->getInput('version') . '!');
default: returnClientError('Unknown version ' . $this->getInput('version') . '!');
}
}
}

View file

@ -8,7 +8,7 @@ class FierPandaBridge extends BridgeAbstract {
const DESCRIPTION = "Returns latest articles from Fier Panda.";
public function collectData(){
$html = $this->getSimpleHTMLDOM(self::URI) or $this->returnServerError('Could not request Fier Panda.');
$html = getSimpleHTMLDOM(self::URI) or returnServerError('Could not request Fier Panda.');
foreach($html->find('div.container-content article') as $element) {
$item = array();

View file

@ -8,8 +8,8 @@ class FlickrExploreBridge extends BridgeAbstract{
const DESCRIPTION = "Returns the latest interesting images from Flickr";
public function collectData(){
$html = $this->getSimpleHTMLDOM(self::URI.'explore')
or $this->returnServerError('Could not request Flickr.');
$html = getSimpleHTMLDOM(self::URI.'explore')
or returnServerError('Could not request Flickr.');
foreach($html->find('.photo-list-photo-view') as $element) {
// Get the styles
@ -23,14 +23,14 @@ class FlickrExploreBridge extends BridgeAbstract{
$imageID = reset($imageURIs);
// Get the image JSON via Flickr API
$imageJSON = json_decode($this->getContents(
$imageJSON = json_decode(getContents(
'https://api.flickr.com/services/rest/?'
.'method=flickr.photos.getInfo&'
.'api_key=103b574d49bd51f0e18bfe907da44a0f&'
.'photo_id='.$imageID.'&'
.'format=json&'
.'nojsoncallback=1'
)) or $this->returnServerError('Could not request Flickr.'); // FIXME: Request time too long...
)) or returnServerError('Could not request Flickr.'); // FIXME: Request time too long...
$item = array();
$item['uri'] = self::URI.'photo.gne?id='.$imageID;

View file

@ -26,12 +26,12 @@ class FlickrTagBridge extends BridgeAbstract{
public function collectData(){
switch($this->queriedContext){
case 'By keyword':
$html = $this->getSimpleHTMLDOM(self::URI.'search/?q='.urlencode($this->getInput('q')).'&s=rec')
or $this->returnServerError('No results for this query.');
$html = getSimpleHTMLDOM(self::URI.'search/?q='.urlencode($this->getInput('q')).'&s=rec')
or returnServerError('No results for this query.');
break;
case 'by username':
$html = $this->getSimpleHTMLDOM(self::URI.'photos/'.urlencode($this->getInput('u')).'/')
or $this->returnServerError('Requested username can\'t be found.');
$html = getSimpleHTMLDOM(self::URI.'photos/'.urlencode($this->getInput('u')).'/')
or returnServerError('Requested username can\'t be found.');
break;
}

View file

@ -7,8 +7,8 @@ class FootitoBridge extends BridgeAbstract{
const DESCRIPTION = "Footito";
public function collectData(){
$html = $this->getSimpleHTMLDOM(self::URI)
or $this->returnServerError('Could not request Footito.');
$html = getSimpleHTMLDOM(self::URI)
or returnServerError('Could not request Footito.');
foreach($html->find('div.post') as $element) {
$item = array();

View file

@ -26,8 +26,8 @@ class FourchanBridge extends BridgeAbstract{
public function collectData(){
$html = $this->getSimpleHTMLDOM($this->getURI())
or $this->returnServerError("Could not request 4chan, thread not found");
$html = getSimpleHTMLDOM($this->getURI())
or returnServerError("Could not request 4chan, thread not found");
foreach($html->find('div.postContainer') as $element) {
$item = array();

View file

@ -86,8 +86,8 @@ class FuturaSciencesBridge extends FeedExpander {
protected function parseItem($newsItem){
$item = parent::parseItem($newsItem);
$item['uri'] = str_replace('#xtor=RSS-8', '', $item['uri']);
$article = $this->getSimpleHTMLDOMCached($item['uri'])
or $this->returnServerError('Could not request Futura-Sciences: ' . $item['uri']);
$article = getSimpleHTMLDOMCached($item['uri'])
or returnServerError('Could not request Futura-Sciences: ' . $item['uri']);
$item['content'] = $this->ExtractArticleContent($article);
$item['author'] = empty($this->ExtractAuthor($article)) ? $item['author'] : $this->ExtractAuthor($article);
return $item;

View file

@ -54,7 +54,7 @@ class GBAtempBridge extends BridgeAbstract {
}
private function fetch_post_content($uri, $site_url) {
$html = $this->getSimpleHTMLDOM($uri);
$html = getSimpleHTMLDOM($uri);
if(!$html){
return 'Could not request GBAtemp '.$uri;
}
@ -65,8 +65,8 @@ class GBAtempBridge extends BridgeAbstract {
public function collectData(){
$html = $this->getSimpleHTMLDOM(self::URI)
or $this->returnServerError('Could not request GBAtemp.');
$html = getSimpleHTMLDOM(self::URI)
or returnServerError('Could not request GBAtemp.');
switch($this->getInput('type')){
case 'N':
@ -82,7 +82,7 @@ class GBAtempBridge extends BridgeAbstract {
foreach ($html->find('li.portal_review') as $reviewItem) {
$url = self::URI.$reviewItem->find('a', 0)->href;
$title = $reviewItem->find('span.review_title', 0)->plaintext;
$content = $this->getSimpleHTMLDOM($url) or $this->returnServerError('Could not request GBAtemp: '.$uri);
$content = getSimpleHTMLDOM($url) or returnServerError('Could not request GBAtemp: '.$uri);
$author = $content->find('a.username', 0)->plaintext;
$time = intval($this->ExtractFromDelimiters($content->find('abbr.DateTime', 0)->outertext, 'data-time="', '"'));
$intro = '<p><b>'.($content->find('div#review_intro', 0)->plaintext).'</b></p>';

View file

@ -23,8 +23,8 @@ class GiphyBridge extends BridgeAbstract{
public function collectData(){
$html = '';
$base_url = 'http://giphy.com';
$html = $this->getSimpleHTMLDOM(self::URI.'/search/'.urlencode($this->getInput('s').'/'))
or $this->returnServerError('No results for this query.');
$html = getSimpleHTMLDOM(self::URI.'/search/'.urlencode($this->getInput('s').'/'))
or returnServerError('No results for this query.');
$max = GIPHY_LIMIT;
if ($this->getInput('n')) {
@ -38,8 +38,8 @@ class GiphyBridge extends BridgeAbstract{
$node = $entry->first_child();
$href = $node->getAttribute('href');
$html2 = $this->getSimpleHTMLDOM(self::URI . $href)
or $this->returnServerError('No results for this query.');
$html2 = getSimpleHTMLDOM(self::URI . $href)
or returnServerError('No results for this query.');
$figure = $html2->getElementByTagName('figure');
$img = $figure->firstChild();
$caption = $figure->lastChild();

View file

@ -136,8 +136,8 @@ class GithubIssueBridge extends BridgeAbstract{
}
public function collectData(){
$html = $this->getSimpleHTMLDOM($this->getURI())
or $this->returnServerError('No results for Github Issue '.$this->getURI());
$html = getSimpleHTMLDOM($this->getURI())
or returnServerError('No results for Github Issue '.$this->getURI());
switch($this->queriedContext){
case 'Issue comments':
@ -153,7 +153,7 @@ class GithubIssueBridge extends BridgeAbstract{
if($this->getInput('c')){
$uri=static::URI.$this->getInput('u').'/'.$this->getInput('p').'/issues/'.$issueNbr;
$issue=$this->getSimpleHTMLDOMCached($uri,static::CACHE_TIMEOUT);
$issue=getSimpleHTMLDOMCached($uri,static::CACHE_TIMEOUT);
if($issue){
$this->items=array_merge($this->items,$this->extractIssueComments($issue));
continue;

View file

@ -10,7 +10,7 @@ class GizmodoBridge extends FeedExpander {
protected function parseItem($item){
$item = parent::parseItem($item);
$articleHTMLContent = $this->getSimpleHTMLDOMCached($item['uri']);
$articleHTMLContent = getSimpleHTMLDOMCached($item['uri']);
if(!$articleHTMLContent){
$text = 'Could not load '.$item['uri'];
}else{

View file

@ -20,13 +20,13 @@ class GooglePlusPostBridge extends BridgeAbstract
public function collectData()
{
// get content parsed
// $html = $this->getSimpleHTMLDOM(__DIR__ . '/../posts2.html'
$html = $this->getSimpleHTMLDOM(self::URI . urlencode($this->getInput('username')) . '/posts'
// $html = getSimpleHTMLDOM(__DIR__ . '/../posts2.html'
$html = getSimpleHTMLDOM(self::URI . urlencode($this->getInput('username')) . '/posts'
// force language
, false, stream_context_create(array('http'=> array(
'header' => 'Accept-Language: fr,fr-be,fr-fr;q=0.8,en;q=0.4,en-us;q=0.2;*' . "\r\n"
)))
) OR $this->returnServerError('No results for this query.');
) OR returnServerError('No results for this query.');
// get title, url, ... there is a lot of intresting stuff in meta
$this->_title = $html->find('meta[property]', 0)->getAttribute('content');

View file

@ -26,10 +26,10 @@ class GoogleSearchBridge extends BridgeAbstract{
public function collectData(){
$html = '';
$html = $this->getSimpleHTMLDOM(self::URI
$html = getSimpleHTMLDOM(self::URI
.'search?q=' . urlencode($this->getInput('q'))
.'&num=100&complete=0&tbs=qdr:y,sbd:1')
or $this->returnServerError('No results for this query.');
or returnServerError('No results for this query.');
$emIsRes = $html->find('div[id=ires]',0);
if( !is_null($emIsRes) ){

View file

@ -31,7 +31,7 @@ class HDWallpapersBridge extends BridgeAbstract {
for ($page = 1; $page <= $lastpage; $page++) {
$link = self::URI.'/'.$category.'/page/'.$page;
$html = $this->getSimpleHTMLDOM($link) or $this->returnServerError('No results for this query.');
$html = getSimpleHTMLDOM($link) or returnServerError('No results for this query.');
if ($page === 1) {
preg_match('/page\/(\d+)$/', $html->find('.pagination a', -2)->href, $matches);

View file

@ -8,8 +8,8 @@ class HentaiHavenBridge extends BridgeAbstract{
const DESCRIPTION = "Returns releases from Hentai Haven";
public function collectData(){
$html = $this->getSimpleHTMLDOM(self::URI)
or $this->returnServerError('Could not request Hentai Haven.');
$html = getSimpleHTMLDOM(self::URI)
or returnServerError('Could not request Hentai Haven.');
foreach($html->find('div.zoe-grid') as $element) {
$item = array();
$item['uri'] = $element->find('div.brick-content h3 a', 0)->href;

View file

@ -15,8 +15,8 @@ class IdenticaBridge extends BridgeAbstract{
));
public function collectData(){
$html = $this->getSimpleHTMLDOM($this->getURI())
or $this->returnServerError('Requested username can\'t be found.');
$html = getSimpleHTMLDOM($this->getURI())
or returnServerError('Requested username can\'t be found.');
foreach($html->find('li.major') as $dent) {
$item = array();

View file

@ -14,8 +14,8 @@ class InstagramBridge extends BridgeAbstract{
));
public function collectData(){
$html = $this->getSimpleHTMLDOM($this->getURI())
or $this->returnServerError('Could not request Instagram.');
$html = getSimpleHTMLDOM($this->getURI())
or returnServerError('Could not request Instagram.');
$innertext = null;

View file

@ -205,21 +205,21 @@ class IsoHuntBridge extends BridgeAbstract{
private function get_movie_torrents($html){
$container = $html->find('div#w0', 0);
if(!$container)
$this->returnServerError('Unable to find torrent container!');
returnServerError('Unable to find torrent container!');
$torrents = $container->find('article');
if(!$torrents)
$this->returnServerError('Unable to find torrents!');
returnServerError('Unable to find torrents!');
foreach($torrents as $torrent){
$anchor = $torrent->find('a', 0);
if(!$anchor)
$this->returnServerError('Unable to find anchor!');
returnServerError('Unable to find anchor!');
$date = $torrent->find('small', 0);
if(!$date)
$this->returnServerError('Unable to find date!');
returnServerError('Unable to find date!');
$item = array();
@ -240,11 +240,11 @@ class IsoHuntBridge extends BridgeAbstract{
private function get_latest_hot_torrents($html){
$container = $html->find('div#serps', 0);
if(!$container)
$this->returnServerError('Unable to find torrent container!');
returnServerError('Unable to find torrent container!');
$torrents = $container->find('tr');
if(!$torrents)
$this->returnServerError('Unable to find torrents!');
returnServerError('Unable to find torrents!');
// Remove first element (header row)
$torrents = array_slice($torrents, 1);
@ -253,11 +253,11 @@ class IsoHuntBridge extends BridgeAbstract{
$cell = $torrent->find('td', 0);
if(!$cell)
$this->returnServerError('Unable to find cell!');
returnServerError('Unable to find cell!');
$element = $cell->find('a', 0);
if(!$element)
$this->returnServerError('Unable to find element!');
returnServerError('Unable to find element!');
$item = array();
@ -278,11 +278,11 @@ class IsoHuntBridge extends BridgeAbstract{
private function get_latest_news($html){
$container = $html->find('div#postcontainer', 0);
if(!$container)
$this->returnServerError('Unable to find post container!');
returnServerError('Unable to find post container!');
$posts = $container->find('div.index-post');
if(!$posts)
$this->returnServerError('Unable to find posts!');
returnServerError('Unable to find posts!');
foreach($posts as $post){
$item = array();
@ -300,7 +300,7 @@ class IsoHuntBridge extends BridgeAbstract{
private function latest_news_extract_author($post){
$author = $post->find('small', 0);
if(!$author)
$this->returnServerError('Unable to find author!');
returnServerError('Unable to find author!');
// The author is hidden within a string like: 'Posted by {author} on {date}'
preg_match('/Posted\sby\s(.*)\son/i', $author->innertext, $matches);
@ -311,7 +311,7 @@ class IsoHuntBridge extends BridgeAbstract{
private function latest_news_extract_timestamp($post){
$date = $post->find('small', 0);
if(!$date)
$this->returnServerError('Unable to find date!');
returnServerError('Unable to find date!');
// The date is hidden within a string like: 'Posted by {author} on {date}'
preg_match('/Posted\sby\s.*\son\s(.*)/i', $date->innertext, $matches);
@ -329,7 +329,7 @@ class IsoHuntBridge extends BridgeAbstract{
private function latest_news_extract_title($post){
$title = $post->find('a', 0);
if(!$title)
$this->returnServerError('Unable to find title!');
returnServerError('Unable to find title!');
return $title->plaintext;
}
@ -337,7 +337,7 @@ class IsoHuntBridge extends BridgeAbstract{
private function latest_news_extract_uri($post){
$uri = $post->find('a', 0);
if(!$uri)
$this->returnServerError('Unable to find uri!');
returnServerError('Unable to find uri!');
return $uri->href;
}
@ -345,7 +345,7 @@ class IsoHuntBridge extends BridgeAbstract{
private function latest_news_extract_content($post){
$content = $post->find('div', 0);
if(!$content)
$this->returnServerError('Unable to find content!');
returnServerError('Unable to find content!');
// Remove <h2>...</h2> (title)
foreach($content->find('h2') as $element){
@ -367,11 +367,11 @@ class IsoHuntBridge extends BridgeAbstract{
private function get_latest_torrents($html){
$container = $html->find('div#serps', 0);
if(!$container)
$this->returnServerError('Unable to find torrent container!');
returnServerError('Unable to find torrent container!');
$torrents = $container->find('tr[data-key]');
if(!$torrents)
$this->returnServerError('Unable to find torrents!');
returnServerError('Unable to find torrents!');
foreach($torrents as $torrent){
$item = array();
@ -389,11 +389,11 @@ class IsoHuntBridge extends BridgeAbstract{
private function latest_torrents_extract_title($torrent){
$cell = $torrent->find('td.title-row', 0);
if(!$cell)
$this->returnServerError('Unable to find title cell!');
returnServerError('Unable to find title cell!');
$title = $cell->find('span', 0);
if(!$title)
$this->returnServerError('Unable to find title!');
returnServerError('Unable to find title!');
return $title->plaintext;
}
@ -401,11 +401,11 @@ class IsoHuntBridge extends BridgeAbstract{
private function latest_torrents_extract_uri($torrent){
$cell = $torrent->find('td.title-row', 0);
if(!$cell)
$this->returnServerError('Unable to find title cell!');
returnServerError('Unable to find title cell!');
$uri = $cell->find('a', 0);
if(!$uri)
$this->returnServerError('Unable to find uri!');
returnServerError('Unable to find uri!');
return $this->fix_relative_uri($uri->href);
}
@ -417,7 +417,7 @@ class IsoHuntBridge extends BridgeAbstract{
$user = $cell->find('a', 0);
if(!$user)
$this->returnServerError('Unable to find user!');
returnServerError('Unable to find user!');
return $user->plaintext;
}
@ -425,7 +425,7 @@ class IsoHuntBridge extends BridgeAbstract{
private function latest_torrents_extract_timestamp($torrent){
$cell = $torrent->find('td.date-row', 0);
if(!$cell)
$this->returnServerError('Unable to find date cell!');
returnServerError('Unable to find date cell!');
return strtotime('-' . $cell->plaintext, time());
}
@ -435,9 +435,9 @@ class IsoHuntBridge extends BridgeAbstract{
#region Generic helper functions
private function load_html($uri){
$html = $this->getSimpleHTMLDOM($uri);
$html = getSimpleHTMLDOM($uri);
if(!$html)
$this->returnServerError('Unable to load ' . $uri . '!');
returnServerError('Unable to load ' . $uri . '!');
return $html;
}

View file

@ -43,8 +43,8 @@ class JapanExpoBridge extends BridgeAbstract {
}
};
$html = $this->getSimpleHTMLDOM(self::URI)
or $this->returnServerError('Could not request JapanExpo: '.self::URI);
$html = getSimpleHTMLDOM(self::URI)
or returnServerError('Could not request JapanExpo: '.self::URI);
$fullcontent = $this->getInput('mode');
$count = 0;
@ -61,7 +61,7 @@ class JapanExpoBridge extends BridgeAbstract {
break;
}
$article_html = $this->getSimpleHTMLDOMCached('Could not request JapanExpo: '.$url);
$article_html = getSimpleHTMLDOMCached('Could not request JapanExpo: '.$url);
$header = $article_html->find('header.pageHeadBox', 0);
$timestamp = strtotime($header->find('time', 0)->datetime);
$title_html = $header->find('div.section', 0)->next_sibling();

View file

@ -9,7 +9,7 @@ class KoreusBridge extends FeedExpander {
protected function parseItem($item) {
$item = parent::parseItem($item);
$html = $this->getSimpleHTMLDOMCached($item['uri']);
$html = getSimpleHTMLDOMCached($item['uri']);
$text = $html->find('p.itemText', 0)->innertext;
$item['content'] = utf8_encode($text);

View file

@ -68,21 +68,21 @@ class KununuBridge extends BridgeAbstract {
$full = $this->getInput('full');
// Load page
$html = $this->getSimpleHTMLDOM($this->getURI());
$html = getSimpleHTMLDOM($this->getURI());
if(!$html)
$this->returnServerError('Unable to receive data from ' . $this->getURI() . '!');
returnServerError('Unable to receive data from ' . $this->getURI() . '!');
// Update name for this request
$this->companyName = $this->extract_company_name($html);
// Find the section with all the panels (reviews)
$section = $html->find('section.kununu-scroll-element', 0);
if($section === false)
$this->returnServerError('Unable to find panel section!');
returnServerError('Unable to find panel section!');
// Find all articles (within the panels)
$articles = $section->find('article');
if($articles === false || empty($articles))
$this->returnServerError('Unable to find articles!');
returnServerError('Unable to find articles!');
// Go through all articles
foreach($articles as $article){
@ -125,11 +125,11 @@ class KununuBridge extends BridgeAbstract {
private function extract_company_name($html){
$panel = $html->find('div.panel', 0);
if($panel === false)
$this->returnServerError('Cannot find panel for company name!');
returnServerError('Cannot find panel for company name!');
$company_name = $panel->find('h1', 0);
if($company_name === false)
$this->returnServerError('Cannot find company name!');
returnServerError('Cannot find company name!');
return $company_name->plaintext;
}
@ -141,7 +141,7 @@ class KununuBridge extends BridgeAbstract {
// They conviniently provide a time attribute for us :)
$date = $article->find('time[itemprop=dtreviewed]', 0);
if($date === false)
$this->returnServerError('Cannot find article date!');
returnServerError('Cannot find article date!');
return strtotime($date->datetime);
}
@ -152,7 +152,7 @@ class KununuBridge extends BridgeAbstract {
private function extract_article_rating($article){
$rating = $article->find('span.rating', 0);
if($rating === false)
$this->returnServerError('Cannot find article rating!');
returnServerError('Cannot find article rating!');
return $rating->getAttribute('aria-label');
}
@ -163,7 +163,7 @@ class KununuBridge extends BridgeAbstract {
private function extract_article_summary($article){
$summary = $article->find('[itemprop=summary]', 0);
if($summary === false)
$this->returnServerError('Cannot find article summary!');
returnServerError('Cannot find article summary!');
return strip_tags($summary->innertext);
}
@ -175,11 +175,11 @@ class KununuBridge extends BridgeAbstract {
// Notice: This first part is the same as in extract_article_summary!
$summary = $article->find('[itemprop=summary]', 0);
if($summary === false)
$this->returnServerError('Cannot find article summary!');
returnServerError('Cannot find article summary!');
$anchor = $summary->find('a', 0);
if($anchor === false)
$this->returnServerError('Cannot find article URI!');
returnServerError('Cannot find article URI!');
return self::URI . $anchor->href;
}
@ -191,7 +191,7 @@ class KununuBridge extends BridgeAbstract {
// We need to parse the aside manually
$aside = $article->find('aside', 0);
if($aside === false)
$this->returnServerError('Cannot find article author information!');
returnServerError('Cannot find article author information!');
// Go through all h2 elements to find index of required span (I know... it's stupid)
$author_position = 'Unknown';
@ -211,7 +211,7 @@ class KununuBridge extends BridgeAbstract {
private function extract_article_description($article){
$description = $article->find('div[itemprop=description]', 0);
if($description === false)
$this->returnServerError('Cannot find article description!');
returnServerError('Cannot find article description!');
return $this->fix_url($description->innertext);
}
@ -221,14 +221,14 @@ class KununuBridge extends BridgeAbstract {
*/
private function extract_full_description($uri){
// Load full article
$html = $this->getSimpleHTMLDOMCached($uri);
$html = getSimpleHTMLDOMCached($uri);
if($html === false)
$this->returnServerError('Could not load full description!');
returnServerError('Could not load full description!');
// Find the article
$article = $html->find('article', 0);
if($article === false)
$this->returnServerError('Cannot find article!');
returnServerError('Cannot find article!');
// Luckily they use the same layout for the review overview and full article pages :)
return $this->extract_article_description($article);

View file

@ -33,8 +33,8 @@ class LWNprevBridge extends BridgeAbstract{
public function collectData(){
// Because the LWN page is written in loose HTML and not XHTML,
// Simple HTML Dom is not accurate enough for the job
$content=$this->getContents($this->getURI())
or $this->returnServerError('No results for LWNprev');
$content=getContents($this->getURI())
or returnServerError('No results for LWNprev');
libxml_use_internal_errors(true);
$html=new DOMDocument();

View file

@ -143,11 +143,11 @@ class LeBonCoinBridge extends BridgeAbstract{
$category='annonces';
}
$html = $this->getSimpleHTMLDOM(
$html = getSimpleHTMLDOM(
self::URI.$category.'/offres/' . $this->getInput('r') . '/?'
.'f=a&th=1&'
.'q=' . urlencode($this->getInput('k'))
) or $this->returnServerError('Could not request LeBonCoin.');
) or returnServerError('Could not request LeBonCoin.');
$list = $html->find('.tabsContent', 0);
if($list === NULL) {

View file

@ -13,8 +13,8 @@ class LeMondeInformatiqueBridge extends FeedExpander {
protected function parseItem($newsItem){
$item = parent::parseItem($newsItem);
$article_html = $this->getSimpleHTMLDOMCached($item['uri'])
or $this->returnServerError('Could not request LeMondeInformatique: ' . $item['uri']);
$article_html = getSimpleHTMLDOMCached($item['uri'])
or returnServerError('Could not request LeMondeInformatique: ' . $item['uri']);
$item['content'] = $this->CleanArticle($article_html->find('div#article', 0)->innertext);
$item['title'] = $article_html->find('h1.cleanprint-title', 0)->plaintext;
return $item;

View file

@ -39,7 +39,7 @@ class LegifranceJOBridge extends BridgeAbstract{
}
public function collectData(){
$html=$this->getSimpleHTMLDOM(self::URI)
$html=getSimpleHTMLDOM(self::URI)
or $this->returnServer('Unable to download '.self::URI);
$this->author=trim($html->find('h2.title',0)->plaintext);

View file

@ -8,8 +8,8 @@ class LesJoiesDuCodeBridge extends BridgeAbstract{
const DESCRIPTION = "LesJoiesDuCode";
public function collectData(){
$html = $this->getSimpleHTMLDOM(self::URI)
or $this->returnServerError('Could not request LesJoiesDuCode.');
$html = getSimpleHTMLDOM(self::URI)
or returnServerError('Could not request LesJoiesDuCode.');
foreach($html->find('div.blog-post') as $element) {
$item = array();

View file

@ -17,7 +17,7 @@ class LichessBridge extends FeedExpander {
}
private function retrieve_lichess_post($blog_post_uri){
$blog_post_html = $this->getSimpleHTMLDOMCached($blog_post_uri);
$blog_post_html = getSimpleHTMLDOMCached($blog_post_uri);
$blog_post_div = $blog_post_html->find('#lichess_blog', 0);
$post_chapo = $blog_post_div->find('.shortlede', 0)->innertext;

View file

@ -18,8 +18,8 @@ class LinkedInCompanyBridge extends BridgeAbstract{
$html = '';
$link = self::URI.'company/'.$this->getInput('c');
$html = $this->getSimpleHTMLDOM($link)
or $this->returnServerError('Could not request LinkedIn.');
$html = getSimpleHTMLDOM($link)
or returnServerError('Could not request LinkedIn.');
foreach($html->find('//*[@id="my-feed-post"]/li') as $element) {
$title = $element->find('span.share-body', 0)->innertext;

View file

@ -79,9 +79,9 @@ class MangareaderBridge extends BridgeAbstract {
public function collectData(){
// We'll use the DOM parser for this as it makes navigation easier
$html = $this->getContents($this->getURI());
$html = getContents($this->getURI());
if(!$html){
$this->returnClientError('Could not receive data for ' . $path . '!');
returnClientError('Could not receive data for ' . $path . '!');
}
libxml_use_internal_errors(true);
$doc = new DomDocument;

View file

@ -22,8 +22,8 @@ class MoebooruBridge extends BridgeAbstract{
}
public function collectData(){
$html = $this->getSimpleHTMLDOM($this->getFullURI())
or $this->returnServerError('Could not request '.$this->getName());
$html = getSimpleHTMLDOM($this->getFullURI())
or returnServerError('Could not request '.$this->getName());
$input_json = explode('Post.register(', $html);

View file

@ -8,8 +8,8 @@ class MondeDiploBridge extends BridgeAbstract{
const DESCRIPTION = "Returns most recent results from MondeDiplo.";
public function collectData(){
$html = $this->getSimpleHTMLDOM(self::URI)
or $this->returnServerError('Could not request MondeDiplo. for : ' . self::URI);
$html = getSimpleHTMLDOM(self::URI)
or returnServerError('Could not request MondeDiplo. for : ' . self::URI);
foreach($html->find('div.unarticle') as $article) {
$element = $article->parent();

View file

@ -11,13 +11,13 @@ class MsnMondeBridge extends BridgeAbstract{
}
private function MsnMondeExtractContent($url, &$item) {
$html2 = $this->getSimpleHTMLDOM($url);
$html2 = getSimpleHTMLDOM($url);
$item['content'] = $html2->find('#content', 0)->find('article', 0)->find('section', 0)->plaintext;
$item['timestamp'] = strtotime($html2->find('.authorinfo-txt', 0)->find('time', 0)->datetime);
}
public function collectData(){
$html = $this->getSimpleHTMLDOM($this->getURI()) or $this->returnServerError('Could not request MsnMonde.');
$html = getSimpleHTMLDOM($this->getURI()) or returnServerError('Could not request MsnMonde.');
$limit = 0;
foreach($html->find('.smalla') as $article) {
if($limit < 10) {

View file

@ -9,7 +9,7 @@ class NasaApodBridge extends BridgeAbstract{
public function collectData(){
$html = $this->getSimpleHTMLDOM(self::URI.'archivepix.html') or $this->returnServerError('Error while downloading the website content');
$html = getSimpleHTMLDOM(self::URI.'archivepix.html') or returnServerError('Error while downloading the website content');
$list = explode("<br>", $html->find('b', 0)->innertext);
for($i = 0; $i < 3;$i++)
@ -21,7 +21,7 @@ class NasaApodBridge extends BridgeAbstract{
$uri = self::URI.$uri_page;
$item['uri'] = $uri;
$picture_html = $this->getSimpleHTMLDOM($uri);
$picture_html = getSimpleHTMLDOM($uri);
$picture_html_string = $picture_html->innertext;
//Extract image and explanation

View file

@ -17,7 +17,7 @@ class NeuviemeArtBridge extends FeedExpander {
protected function parseItem($item){
$item = parent::parseItem($item);
$article_html = $this->getSimpleHTMLDOMCached($item['uri']);
$article_html = getSimpleHTMLDOMCached($item['uri']);
if(!$article_html){
$item['content'] = 'Could not request 9eme Art: '.$item['uri'];
return $item;

View file

@ -17,7 +17,7 @@ class NextInpactBridge extends FeedExpander {
}
private function ExtractContent($url) {
$html2 = $this->getSimpleHTMLDOMCached($url);
$html2 = getSimpleHTMLDOMCached($url);
$text = '<p><em>'.$html2->find('span.sub_title', 0)->innertext.'</em></p>'
.'<p><img src="'.$html2->find('div.container_main_image_article', 0)->find('img.dedicated',0)->src.'" alt="-" /></p>'
.'<div>'.$html2->find('div[itemprop=articleBody]', 0)->innertext.'</div>';

View file

@ -56,8 +56,8 @@ class NextgovBridge extends FeedExpander {
}
private function ExtractContent($url){
$article = $this->getSimpleHTMLDOMCached($url)
or $this->returnServerError('Could not request Nextgov: ' . $url);
$article = getSimpleHTMLDOMCached($url)
or returnServerError('Could not request Nextgov: ' . $url);
$contents = $article->find('div.wysiwyg', 0)->innertext;
$contents = $this->StripWithDelimiters($contents, '<div class="ad-container">', '</div>');

View file

@ -17,7 +17,7 @@ class NiceMatinBridge extends FeedExpander {
}
private function NiceMatinExtractContent($url) {
$html = $this->getSimpleHTMLDOMCached($url);
$html = getSimpleHTMLDOMCached($url);
if(!$html)
return 'Could not acquire content from url: ' . $url . '!';

View file

@ -21,8 +21,8 @@ class NovelUpdatesBridge extends BridgeAbstract{
}
public function collectData(){
$fullhtml = $this->getSimpleHTMLDOM($this->getURI())
or $this->returnServerError('Could not request NovelUpdates, novel "'.$this->getInput('n').'" not found');
$fullhtml = getSimpleHTMLDOM($this->getURI())
or returnServerError('Could not request NovelUpdates, novel "'.$this->getInput('n').'" not found');
$this->seriesTitle = $fullhtml->find('h4.seriestitle', 0)->plaintext;
// dirty fix for nasty simpledom bug: https://github.com/sebsauvage/rss-bridge/issues/259

View file

@ -32,8 +32,8 @@ class OpenClassroomsBridge extends BridgeAbstract{
}
public function collectData(){
$html = $this->getSimpleHTMLDOM($this->getURI())
or $this->returnServerError('Could not request OpenClassrooms.');
$html = getSimpleHTMLDOM($this->getURI())
or returnServerError('Could not request OpenClassrooms.');
foreach($html->find('.courseListItem') as $element) {
$item = array();

View file

@ -26,8 +26,8 @@ class ParuVenduImmoBridge extends BridgeAbstract
public function collectData()
{
$html = $this->getSimpleHTMLDOM($this->getURI())
or $this->returnServerError('Could not request paruvendu.');
$html = getSimpleHTMLDOM($this->getURI())
or returnServerError('Could not request paruvendu.');
foreach($html->find('div.annonce a') as $element) {

View file

@ -34,8 +34,8 @@ class PickyWallpapersBridge extends BridgeAbstract {
$resolution = $this->getInput('r'); // Wide wallpaper default
for ($page = 1; $page <= $lastpage; $page++) {
$html = $this->getSimpleHTMLDOM($this->getURI().'/page-'.$page.'/')
or $this->returnServerError('No results for this query.');
$html = getSimpleHTMLDOM($this->getURI().'/page-'.$page.'/')
or returnServerError('No results for this query.');
if ($page === 1) {
preg_match('/page-(\d+)\/$/', $html->find('.pages li a', -2)->href, $matches);

View file

@ -26,13 +26,13 @@ class PinterestBridge extends BridgeAbstract {
);
public function collectData(){
$html = $this->getSimpleHTMLDOM($this->getURI());
$html = getSimpleHTMLDOM($this->getURI());
if(!$html){
switch($this->queriedContext){
case 'By username and board':
$this->returnServerError('Username and/or board not found');
returnServerError('Username and/or board not found');
case 'From search':
$this->returnServerError('Could not request Pinterest.');
returnServerError('Could not request Pinterest.');
}
}
@ -72,7 +72,7 @@ class PinterestBridge extends BridgeAbstract {
}
} elseif($this->queriedContext === 'By username and board'){
$container = $html->find('SCRIPT[type="application/ld+json"]', 0)
or $this->returnServerError('Unable to find data container!');
or returnServerError('Unable to find data container!');
$json = json_decode($container->innertext, true);

View file

@ -7,14 +7,14 @@ class PlanetLibreBridge extends BridgeAbstract{
const DESCRIPTION = "Returns the 5 newest posts from PlanetLibre (full text)";
private function PlanetLibreExtractContent($url){
$html2 = $this->getSimpleHTMLDOM($url);
$html2 = getSimpleHTMLDOM($url);
$text = $html2->find('div[class="post-text"]', 0)->innertext;
return $text;
}
public function collectData(){
$html = $this->getSimpleHTMLDOM(self::URI)
or $this->returnServerError('Could not request PlanetLibre.');
$html = getSimpleHTMLDOM(self::URI)
or returnServerError('Could not request PlanetLibre.');
$limit = 0;
foreach($html->find('div.post') as $element) {
if($limit < 5) {

View file

@ -19,8 +19,8 @@ class RTBFBridge extends BridgeAbstract {
$limit = 10;
$count = 0;
$html = $this->getSimpleHTMLDOM($this->getURI())
or $this->returnServerError('Could not request RTBF.');
$html = getSimpleHTMLDOM($this->getURI())
or returnServerError('Could not request RTBF.');
foreach($html->find('section[id!=widget-ml-avoiraussi-] .rtbf-media-grid article') as $element) {
if($count >= $limit) {

View file

@ -34,7 +34,7 @@ class Releases3DSBridge extends BridgeAbstract {
}
$dataUrl = self::URI.'xml.php';
$xml = $this->getContents($dataUrl) or $this->returnServerError('Could not request 3dsdb: '.$dataUrl);
$xml = getContents($dataUrl) or returnServerError('Could not request 3dsdb: '.$dataUrl);
$limit = 0;
foreach (array_reverse(explode('<release>', $xml)) as $element) {
@ -69,7 +69,7 @@ class Releases3DSBridge extends BridgeAbstract {
//Retrieve cover art and short desc from IGN?
$ignResult = false; $ignDescription = ''; $ignLink = ''; $ignDate = time(); $ignCoverArt = '';
$ignSearchUrl = 'http://www.ign.com/search?q='.urlencode($name);
if ($ignResult = $this->getSimpleHTMLDOM($ignSearchUrl)) {
if ($ignResult = getSimpleHTMLDOM($ignSearchUrl)) {
$ignCoverArt = $ignResult->find('div.search-item-media', 0)->find('img', 0)->src;
$ignDesc = $ignResult->find('div.search-item-description', 0)->plaintext;
$ignLink = $ignResult->find('div.search-item-sub-title', 0)->find('a', 1)->href;

View file

@ -7,7 +7,7 @@ class ReporterreBridge extends BridgeAbstract{
const DESCRIPTION = "Returns the newest articles.";
private function ExtractContentReporterre($url) {
$html2 = $this->getSimpleHTMLDOM($url);
$html2 = getSimpleHTMLDOM($url);
foreach($html2->find('div[style=text-align:justify]') as $e) {
$text = $e->outertext;
@ -24,7 +24,7 @@ class ReporterreBridge extends BridgeAbstract{
}
public function collectData(){
$html = $this->getSimpleHTMLDOM(self::URI.'spip.php?page=backend') or $this->returnServerError('Could not request Reporterre.');
$html = getSimpleHTMLDOM(self::URI.'spip.php?page=backend') or returnServerError('Could not request Reporterre.');
$limit = 0;
foreach($html->find('item') as $element) {

View file

@ -10,7 +10,7 @@ class Rue89Bridge extends FeedExpander {
$item = parent::parseItem($item);
$url = "http://api.rue89.nouvelobs.com/export/mobile2/node/" . str_replace(" ", "", substr($item['uri'], -8)) . "/full";
$datas = json_decode($this->getContents($url), true);
$datas = json_decode(getContents($url), true);
$item['content'] = $datas['node']['body'];
return $item;

View file

@ -9,8 +9,8 @@ class ScmbBridge extends BridgeAbstract{
public function collectData(){
$html = '';
$html = $this->getSimpleHTMLDOM(self::URI)
or $this->returnServerError('Could not request Se Coucher Moins Bete.');
$html = getSimpleHTMLDOM(self::URI)
or returnServerError('Could not request Se Coucher Moins Bete.');
foreach($html->find('article') as $article) {
$item = array();

View file

@ -18,8 +18,8 @@ class ScoopItBridge extends BridgeAbstract{
$this->request = $this->getInput('u');
$link = self::URI.'search?q=' .urlencode($this->getInput('u'));
$html = $this->getSimpleHTMLDOM($link)
or $this->returnServerError('Could not request ScoopIt. for : ' . $link);
$html = getSimpleHTMLDOM($link)
or returnServerError('Could not request ScoopIt. for : ' . $link);
foreach($html->find('div.post-view') as $element) {
$item = array();

View file

@ -47,8 +47,8 @@ class SensCritiqueBridge extends BridgeAbstract {
case 'bd': $uri.='bd/actualite'; break;
case 'mu': $uri.='musique/actualite'; break;
}
$html = $this->getSimpleHTMLDOM($uri)
or $this->returnServerError('No results for this query.');
$html = getSimpleHTMLDOM($uri)
or returnServerError('No results for this query.');
$list = $html->find('ul.elpr-list', 0);
$this->extractDataFromList($list);
@ -58,7 +58,7 @@ class SensCritiqueBridge extends BridgeAbstract {
private function extractDataFromList($list) {
if ($list === null) {
$this->returnClientError('Cannot extract data from list');
returnClientError('Cannot extract data from list');
}
foreach ($list->find('li') as $movie) {

View file

@ -11,7 +11,7 @@ class SexactuBridge extends BridgeAbstract{
$find = array('janvier', 'février', 'mars', 'avril', 'mai', 'juin', 'juillet', 'août', 'septembre', 'novembre', 'décembre');
$replace = array('January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December');
$html = $this->getSimpleHTMLDOM($this->getURI()) or $this->returnServerError('Could not request '.$this->getURI());
$html = getSimpleHTMLDOM($this->getURI()) or returnServerError('Could not request '.$this->getURI());
foreach($html->find('.content-holder') as $contentHolder) {
// only use first list as second one only contains pages numbers

View file

@ -8,17 +8,17 @@ class ShanaprojectBridge extends BridgeAbstract {
// Returns an html object for the Season Anime List (latest season)
private function LoadSeasonAnimeList(){
// First we need to find the URI to the latest season from the 'seasons' page searching for 'Season Anime List'
$html = $this->getSimpleHTMLDOM($this->getURI() . '/seasons');
$html = getSimpleHTMLDOM($this->getURI() . '/seasons');
if(!$html)
$this->returnServerError('Could not load \'seasons\' page!');
returnServerError('Could not load \'seasons\' page!');
$season = $html->find('div.follows_menu/a', 1);
if(!$season)
$this->returnServerError('Could not find \'Season Anime List\'!');
returnServerError('Could not find \'Season Anime List\'!');
$html = $this->getSimpleHTMLDOM($this->getURI() . $season->href);
$html = getSimpleHTMLDOM($this->getURI() . $season->href);
if(!$html)
$this->returnServerError('Could not load \'Season Anime List\' from \'' . $season->innertext . '\'!');
returnServerError('Could not load \'Season Anime List\' from \'' . $season->innertext . '\'!');
return $html;
}
@ -27,7 +27,7 @@ class ShanaprojectBridge extends BridgeAbstract {
private function ExtractAnimeTitle($anime){
$title = $anime->find('a', 0);
if(!$title)
$this->returnServerError('Could not find anime title!');
returnServerError('Could not find anime title!');
return trim($title->innertext);
}
@ -35,7 +35,7 @@ class ShanaprojectBridge extends BridgeAbstract {
private function ExtractAnimeURI($anime){
$uri = $anime->find('a', 0);
if(!$uri)
$this->returnServerError('Could not find anime URI!');
returnServerError('Could not find anime URI!');
return $this->getURI() . $uri->href;
}
@ -43,7 +43,7 @@ class ShanaprojectBridge extends BridgeAbstract {
private function ExtractAnimeTimestamp($anime){
$timestamp = $anime->find('span.header_info_block', 1);
if(!$timestamp)
$this->returnServerError('Could not find anime timestamp!');
returnServerError('Could not find anime timestamp!');
return strtotime($timestamp->innertext);
}
@ -59,7 +59,7 @@ class ShanaprojectBridge extends BridgeAbstract {
private function ExtractAnimeEpisodeInformation($anime){
$episode = $anime->find('div.header_info_episode', 0);
if(!$episode)
$this->returnServerError('Could not find anime episode information!');
returnServerError('Could not find anime episode information!');
return preg_replace('/\r|\n/', ' ', $episode->plaintext);
}
@ -71,7 +71,7 @@ class ShanaprojectBridge extends BridgeAbstract {
if(preg_match("/url\(\/\/([^\)]+)\)/i", $anime->parent->style, $matches))
return $matches[1];
$this->returnServerError('Could not extract background image!');
returnServerError('Could not extract background image!');
}
// Builds an URI to search for a specific anime (subber is left empty)
@ -94,7 +94,7 @@ class ShanaprojectBridge extends BridgeAbstract {
$animes = $html->find('div.header_display_box_info');
if(!$animes)
$this->returnServerError('Could not find anime headers!');
returnServerError('Could not find anime headers!');
foreach($animes as $anime){
$item = array();

View file

@ -18,16 +18,16 @@ class SoundCloudBridge extends BridgeAbstract{
public function collectData(){
$res = json_decode($this->getContents(
$res = json_decode(getContents(
'https://api.soundcloud.com/resolve?url=http://www.soundcloud.com/'
. urlencode($this->getInput('u'))
.'&client_id=' . self::CLIENT_ID
)) or $this->returnServerError('No results for this query');
$tracks = json_decode($this->getContents(
)) or returnServerError('No results for this query');
$tracks = json_decode(getContents(
'https://api.soundcloud.com/users/'
. urlencode($res->id)
.'/tracks?client_id=' . self::CLIENT_ID
)) or $this->returnServerError('No results for this user');
)) or returnServerError('No results for this user');
for ($i=0; $i < 10; $i++) {
$item = array();

View file

@ -7,8 +7,8 @@ class StripeAPIChangeLogBridge extends BridgeAbstract{
const DESCRIPTION = 'Returns the changes made to the stripe.com API';
public function collectData(){
$html = $this->getSimpleHTMLDOM(self::URI)
or $this->returnServerError('No results for Stripe API Changelog');
$html = getSimpleHTMLDOM(self::URI)
or returnServerError('No results for Stripe API Changelog');
foreach($html->find('h3') as $change){

View file

@ -33,15 +33,15 @@ class SuperbWallpapersBridge extends BridgeAbstract {
// Get last page number
$link = self::URI.'/'.$category.'/9999.html';
$html = $this->getSimpleHTMLDOM($link)
or $this->returnServerError('Could not load '.$link);
$html = getSimpleHTMLDOM($link)
or returnServerError('Could not load '.$link);
$lastpage = min($html->find('.paging .cpage', 0)->innertext(), ceil($max/36));
for ($page = 1; $page <= $lastpage; $page++) {
$link = self::URI.'/'.$category.'/'.$page.'.html';
$html = $this->getSimpleHTMLDOM($link)
or $this->returnServerError('No results for this query.');
$html = getSimpleHTMLDOM($link)
or returnServerError('No results for this query.');
foreach($html->find('.wpl .i a') as $element) {
$thumbnail = $element->find('img', 0);

View file

@ -26,12 +26,12 @@ class T411Bridge extends BridgeAbstract {
//Retrieve torrent listing from search results, which does not contain torrent description
$url = self::URI.'torrents/search/?'.$this->getInput('search').'&order=added&type=desc';
$html = $this->getSimpleHTMLDOM($url)
or $this->returnServerError('Could not request t411: '.$url);
$html = getSimpleHTMLDOM($url)
or returnServerError('Could not request t411: '.$url);
$results = $html->find('table.results', 0);
if (is_null($results))
$this->returnServerError('No results from t411: '.$url);
returnServerError('No results from t411: '.$url);
$limit = 0;
//Process each item individually
@ -54,7 +54,7 @@ class T411Bridge extends BridgeAbstract {
$item_date = strtotime($element->find('dd', 0)->plaintext);
//Retrieve full description from torrent page
$item_html = $this->getSimpleHTMLDOM($item_uri);
$item_html = getSimpleHTMLDOM($item_uri);
if (!$item_html) {
continue;
}

View file

@ -17,8 +17,8 @@ class TagBoardBridge extends BridgeAbstract{
public function collectData(){
$link = 'https://post-cache.tagboard.com/search/' .$this->getInput('u');
$html = $this->getSimpleHTMLDOM($link)
or $this->returnServerError('Could not request TagBoard for : ' . $link);
$html = getSimpleHTMLDOM($link)
or returnServerError('Could not request TagBoard for : ' . $link);
$parsed_json = json_decode($html);
foreach($parsed_json->{'posts'} as $element) {

View file

@ -8,8 +8,8 @@ class TheCodingLoveBridge extends BridgeAbstract{
const DESCRIPTION = "The Coding Love";
public function collectData(){
$html = $this->getSimpleHTMLDOM(self::URI)
or $this->returnServerError('Could not request The Coding Love.');
$html = getSimpleHTMLDOM(self::URI)
or returnServerError('Could not request The Coding Love.');
foreach($html->find('div.post') as $element) {
$item = array();

View file

@ -40,7 +40,7 @@ class TheHackerNewsBridge extends BridgeAbstract {
return $string;
}
$html = $this->getSimpleHTMLDOM($this->getURI()) or $this->returnServerError('Could not request TheHackerNews: '.$this->getURI());
$html = getSimpleHTMLDOM($this->getURI()) or returnServerError('Could not request TheHackerNews: '.$this->getURI());
$limit = 0;
foreach ($html->find('article') as $element) {
@ -50,7 +50,7 @@ class TheHackerNewsBridge extends BridgeAbstract {
$article_author = trim($element->find('span.vcard', 0)->plaintext);
$article_title = $element->find('a.entry-title', 0)->plaintext;
$article_timestamp = strtotime($element->find('span.updated', 0)->plaintext);
$article = $this->getSimpleHTMLDOM($article_url) or $this->returnServerError('Could not request TheHackerNews: '.$article_url);
$article = getSimpleHTMLDOM($article_url) or returnServerError('Could not request TheHackerNews: '.$article_url);
$contents = $article->find('div.articlebodyonly', 0)->innertext;
$contents = StripRecursiveHTMLSection($contents, 'div', '<div class=\'clear\'');

View file

@ -14,7 +14,7 @@ class TheOatmealBridge extends FeedExpander{
protected function parseItem($newsItem) {
$item = parent::parseItem($newsItem);
$articlePage = $this->getSimpleHTMLDOMCached($item['uri']);
$articlePage = getSimpleHTMLDOMCached($item['uri']);
$content = $articlePage->find('#comic', 0);
if(is_null($content)) // load alternative
$content = $articlePage->find('#blog', 0);

View file

@ -18,7 +18,7 @@ class ThePirateBayBridge extends BridgeAbstract{
'values'=>array(
'search'=>'search',
'category'=>'cat',
'user'=>'usr'
'user'=>'usr'
)
),
'cat_check'=>array(
@ -70,7 +70,7 @@ class ThePirateBayBridge extends BridgeAbstract{
if ($catBool)
{
$catNum = $this->getInput('cat');
}
}
$critList = $this->getInput('crit');
$keywordsList = explode(";",$this->getInput('q'));
foreach($keywordsList as $keywords){
@ -78,33 +78,32 @@ class ThePirateBayBridge extends BridgeAbstract{
case "search":
if ($catBool == FALSE)
{
$html = $this->getSimpleHTMLDOM(self::URI.'search/'.rawurlencode($keywords).'/0/3/0')
or $this->returnServerError('Could not request TPB.');
$html = getSimpleHTMLDOM(self::URI.'search/'.rawurlencode($keywords).'/0/3/0')
or returnServerError('Could not request TPB.');
}
else
{
$html = $this->getSimpleHTMLDOM(self::URI.'search/'.rawurlencode($keywords).'/0/3/'.rawurlencode($catNum))
or $this->returnServerError('Could not request TPB.');
$html = getSimpleHTMLDOM(self::URI.'search/'.rawurlencode($keywords).'/0/3/'.rawurlencode($catNum))
or returnServerError('Could not request TPB.');
}
break;
case "cat":
$html = $this->getSimpleHTMLDOM(self::URI.'browse/'.rawurlencode($keywords).'/0/3/0')
or $this->returnServerError('Could not request TPB.');
$html = getSimpleHTMLDOM(self::URI.'browse/'.rawurlencode($keywords).'/0/3/0')
or returnServerError('Could not request TPB.');
break;
case "usr":
$html = $this->getSimpleHTMLDOM(self::URI.'user/'.rawurlencode($keywords).'/0/3/0')
or $this->returnServerError('Could not request TPB.');
$html = getSimpleHTMLDOM(self::URI.'user/'.rawurlencode($keywords).'/0/3/0')
or returnServerError('Could not request TPB.');
break;
}
if ($html->find('table#searchResult', 0) == FALSE)
$this->returnServerError('No result for query '.$keywords);
returnServerError('No result for query '.$keywords);
foreach($html->find('tr') as $element) {
$item = array();
$item['uri'] = $element->find('a',3)->href;
$item['uri'] = $element->find('a',3)->href;
$item['id'] = self::URI.$element->find('a.detLink',0)->href;
$item['timestamp'] = parseDateTimestamp($element);
$item['author'] = $element->find('a.detDesc',0)->plaintext;

View file

@ -71,10 +71,10 @@ class TwitchApiBridge extends BridgeAbstract{
/* Finally we're ready to request data from the API. Each response provides information for the next request. */
for($i = 0; $i < $requests; $i++) {
$response = $this->getSimpleHTMLDOM($request, false, $context);
$response = getSimpleHTMLDOM($request, false, $context);
if($response == false) {
$this->returnServerError('Request failed! Check if the channel name is valid!');
returnServerError('Request failed! Check if the channel name is valid!');
}
$data = json_decode($response);

View file

@ -62,13 +62,13 @@ class TwitterBridge extends BridgeAbstract{
public function collectData(){
$html = '';
$html = $this->getSimpleHTMLDOM($this->getURI());
$html = getSimpleHTMLDOM($this->getURI());
if(!$html){
switch($this->queriedContext){
case 'By keyword or hashtag':
$this->returnServerError('No results for this query.');
returnServerError('No results for this query.');
case 'By username':
$this->returnServerError('Requested username can\'t be found.');
returnServerError('Requested username can\'t be found.');
}
}

View file

@ -34,8 +34,8 @@ class UnsplashBridge extends BridgeAbstract {
for ($page = 1; $page <= $lastpage; $page++) {
$link = self::URI.'/grid?page='.$page;
$html = $this->getSimpleHTMLDOM($link)
or $this->returnServerError('No results for this query.');
$html = getSimpleHTMLDOM($link)
or returnServerError('No results for this query.');
if ($page === 1) {
preg_match('/=(\d+)$/', $html->find('.pagination > a[!class]', -1)->href, $matches);

View file

@ -18,8 +18,8 @@ class ViadeoCompanyBridge extends BridgeAbstract{
$html = '';
$link = self::URI.'fr/company/'.$this->getInput('c');
$html = $this->getSimpleHTMLDOM($link)
or $this->returnServerError('Could not request Viadeo.');
$html = getSimpleHTMLDOM($link)
or returnServerError('Could not request Viadeo.');
foreach($html->find('//*[@id="company-newsfeed"]/ul/li') as $element) {
$title = $element->find('p', 0)->innertext;

View file

@ -17,8 +17,8 @@ class VineBridge extends BridgeAbstract {
$html = '';
$uri = self::URI.'/u/'.$this->getInput('u').'?mode=list';
$html = $this->getSimpleHTMLDOM($uri)
or $this->returnServerError('No results for this query.');
$html = getSimpleHTMLDOM($uri)
or returnServerError('No results for this query.');
foreach($html->find('.post') as $element) {
$a = $element->find('a', 0);

View file

@ -19,8 +19,8 @@ class VkBridge extends BridgeAbstract {
return static::URI.urlencode($this->getInput('u'));
}
public function collectData(){
$text_html = $this->getContents($this->getURI())
or $this->returnServerError('No results for group or user name "'.$this->getInput('u').'".');
$text_html = getContents($this->getURI())
or returnServerError('No results for group or user name "'.$this->getInput('u').'".');
$text_html = iconv('windows-1251', 'utf-8', $text_html);
$html = str_get_html($text_html);

View file

@ -34,8 +34,8 @@ class WallpaperStopBridge extends BridgeAbstract {
for ($page = 1; $page <= $lastpage; $page++) {
$link = self::URI.'/'.$category.'-wallpaper/'.(!empty($subcategory)?$subcategory.'-wallpaper/':'').'desktop-wallpaper-'.$page.'.html';
$html = $this->getSimpleHTMLDOM($link)
or $this->returnServerError('No results for this query.');
$html = getSimpleHTMLDOM($link)
or returnServerError('No results for this query.');
if ($page === 1) {
preg_match('/-(\d+)\.html$/', $html->find('.pagination > .last', 0)->href, $matches);

View file

@ -18,7 +18,7 @@ class WeLiveSecurityBridge extends FeedExpander {
protected function parseItem($item){
$item = parent::parseItem($item);
$article_html = $this->getSimpleHTMLDOMCached($item['uri']);
$article_html = getSimpleHTMLDOMCached($item['uri']);
if(!$article_html){
$item['content'] .= '<p>Could not request '.$this->getName().': '.$item['uri'].'</p>';
return $item;

View file

@ -20,19 +20,19 @@ class WhydBridge extends BridgeAbstract{
$html = '';
if (strlen(preg_replace("/[^0-9a-f]/",'', $this->getInput('u'))) == 24){
// is input the userid ?
$html = $this->getSimpleHTMLDOM(
$html = getSimpleHTMLDOM(
self::URI.'u/'.preg_replace("/[^0-9a-f]/",'', $this->getInput('u'))
) or $this->returnServerError('No results for this query.');
) or returnServerError('No results for this query.');
} else { // input may be the username
$html = $this->getSimpleHTMLDOM(
$html = getSimpleHTMLDOM(
self::URI.'search?q='.urlencode($this->getInput('u'))
) or $this->returnServerError('No results for this query.');
) or returnServerError('No results for this query.');
for ($j = 0; $j < 5; $j++) {
if (strtolower($html->find('div.user', $j)->find('a',0)->plaintext) == strtolower($this->getInput('u'))) {
$html = $this->getSimpleHTMLDOM(
$html = getSimpleHTMLDOM(
self::URI . $html->find('div.user', $j)->find('a', 0)->getAttribute('href')
) or $this->returnServerError('No results for this query');
) or returnServerError('No results for this query');
break;
}
}

Some files were not shown because too many files have changed in this diff Show more