maintainer = "aledeg";
$this->name = "Wordpress Bridge";
$this->uri = "https://wordpress.org/";
$this->description = "Returns the 3 newest full posts of a Wordpress blog";
$this->update = "2016-08-04";
$this->parameters[] =
'[
{
"name" : "blog URL",
"required" : "true",
"identifier" : "url"
}
]';
}
// Returns the content type for a given html dom
function DetectContentType($html){
if($html->find('entry'))
return WORDPRESS_TYPE_ATOM;
if($html->find('item'))
return WORDPRESS_TYPE_RSS;
return WORDPRESS_TYPE_ATOM; // Make ATOM default
}
// Replaces all 'link' tags with 'url' for simplehtmldom to actually find 'links' ('url')
function ReplaceLinkTagsWithUrlTags($element){
// We need to fix the 'link' tag as simplehtmldom cannot parse it (just rename it and load back as dom)
$element_text = $element->outertext;
$element_text = str_replace('', '', $element_text);
$element_text = str_replace('', '', $element_text);
$element_text = str_replace('', '', $string);
return $string;
}
function ClearContent($content) {
$content = preg_replace('/