Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class Ff_Ibm extends Plugin {
- private $link;
- private $host;
- function about() {
- return array(1.0,
- "Strips html code from the IBM feed",
- "fleg",
- false);
- }
- function init($host) {
- $this->link = $host->get_link();
- $this->host = $host;
- $host->add_hook($host::HOOK_FEED_FETCHED, $this);
- }
- function hook_feed_fetched($feed_data) {
- #_debug("---[ ff_ibm ]---");
- if( preg_match('/IBM developer\s*works/i', $feed_data) ){
- _debug('ff_ibm: IBM Feed found, correcting raw feed.');
- $feed_data = preg_replace('/<\/feed>[\n\r\s]*<[^<>]*doctype html[^<>]+>.*html.*<\/html>/ims', '</feed>', $feed_data);
- }
- //_debug($feed_data);
- #_debug("---[ ff_ibm ]---");
- return $feed_data;
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement