From 8b8c53b6a821dc08b8562ac9a278d2f5b12bfdf9 Mon Sep 17 00:00:00 2001 From: wjames5 Date: Wed, 27 May 2009 17:11:06 +0000 Subject: add filter for cnbc --- htmlpure/Filter/CNBC.php | 56 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 htmlpure/Filter/CNBC.php diff --git a/htmlpure/Filter/CNBC.php b/htmlpure/Filter/CNBC.php new file mode 100644 index 0000000..f8bfdde --- /dev/null +++ b/htmlpure/Filter/CNBC.php @@ -0,0 +1,56 @@ +#s'; + $pre_replace = '\6'; + $ret = preg_replace($pre_regex, $pre_replace, $html); + return $ret; + } + + public function postFilter($html, $config, &$context) { + $width = '\1'; + $height = '\2'; + + /* the CNBC embed size may be fixed by the swf app and so it may never be possible to override + // @config->def->info['bitweaver']['CNBC'] params width and height will force the size of the video + if( !empty( $config->def->info['bitweaver']['CNBC'] ) ){ + $moviesize = $config->def->info['bitweaver']['CNBC']; + $width = $moviesize['width']; + $height = $moviesize['height']; + } + */ + + $src_url='http://plus.cnbc.com/rssvideosearch/action/player/id/\3/code/cnbcplayershare'; + + $post_regex = '#([A-Za-z0-9\-_]+)#'; + $post_replace = '
+ + + + + + + + + + +
'; + $ret = preg_replace($post_regex, $post_replace, $html); + return $ret; + } + +} + -- cgit v1.3