Created
November 4, 2024 11:27
-
-
Save qiwichupa/398538abbd60f94194e779e48d0cfd81 to your computer and use it in GitHub Desktop.
плагин tt-rss для исправления ссылок в rss сайта joyreactor.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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