Skip to content

Instantly share code, notes, and snippets.

@qiwichupa
Created November 4, 2024 11:27
Show Gist options
  • Save qiwichupa/398538abbd60f94194e779e48d0cfd81 to your computer and use it in GitHub Desktop.
Save qiwichupa/398538abbd60f94194e779e48d0cfd81 to your computer and use it in GitHub Desktop.
плагин tt-rss для исправления ссылок в rss сайта joyreactor.cc
<?php
class af_joyreactor_url2main extends Plugin {
private $host;
function about() {
return array(1.0,
"Исправление ссылок на статьи сайта joyreactor.cc",
"qiwichupa");
}
function init($host) {
$this->host = $host;
$host->add_hook($host::HOOK_ARTICLE_FILTER, $this);
}
function hook_article_filter($article) {
if(strpos($article['link'], 'joy.reactor.cc') !== FALSE){
$article['link'] = str_replace('joy.reactor.cc', 'joyreactor.cc', $article['link']);
}
return $article;
}
function api_version() {
return 2;
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment