tag:blogger.com,1999:blog-13626413.post113263203957364918..comments2023-10-29T03:14:00.066-07:00Comments on Vlajbert's Greasemonkey Scripts: Update -- CNN Friendly VideoVlajberthttp://www.blogger.com/profile/00371657412750821286noreply@blogger.comBlogger1125tag:blogger.com,1999:blog-13626413.post-86993689988994726182007-06-29T00:01:00.000-07:002007-06-29T00:01:00.000-07:00Scrip didn't work with "CNN In The News" http://ww...Scrip didn't work with "CNN In The News" http://www.cnn.com/video/nitn/latest/content.htm so I had changed a bit;<BR/><BR/><BR/><BR/>// Copyright (c) 2005, Vlajbert<BR/>//<BR/>// --------------------------------------------------------------------<BR/>//<BR/>// This is a Greasemonkey user script.<BR/>//<BR/>// To install, you need Greasemonkey: http://greasemonkey.mozdev.org/<BR/>// Then restart Firefox and revisit this script.<BR/>// Under Tools, there will be a new menu item to "Install User Script".<BR/>// Accept the default configuration and install.<BR/>//<BR/>// To uninstall, go to Tools/Manage User Scripts,<BR/>// select "CNN Friendly Video", and click Uninstall.<BR/>//<BR/>// --------------------------------------------------------------------<BR/>//<BR/>// ==UserScript==<BR/>// @name CNN Friendly Video<BR/>// @namespace http://vlajbert.blogspot.com/<BR/>// @description Replaces the video anchors with a link directly to the wmv file.<BR/>// @include http://www.cnn.com/video/*<BR/>// @version 0.0.4<BR/>// ==/UserScript==<BR/><BR/>// NOTE!!! If you don't want to use cnn's video player then set bypassplayer to 1. This<BR/>// will link the videos directoy to the stream.<BR/><BR/>var bypassplayer = 0;<BR/><BR/>(function() {<BR/> var plyr = document.getElementById('cnnVidPlayer');<BR/> if( plyr ) {<BR/> var obj = plyr.parentNode;<BR/> var p = obj.innerHTML;<BR/> var beginRemove = p.indexOf('.ws.asx?NGU');<BR/> var endRemove = p.lastIndexOf('">',beginRemove);<BR/> obj.innerHTML= p.substring(0,beginRemove) + '.ws_noads.asx' + p.substring(endRemove);<BR/> }<BR/><BR/><BR/><BR/>function getObject( obj, xpath) {<BR/> try { return document.evaluate( xpath, obj, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue; } <BR/> catch( e) { return null; }<BR/> }<BR/><BR/>function loc() {<BR/> var l = document.location.href;<BR/> var foo = l.replace( /\?/, "\n");<BR/> foo = foo.replace( /&/g, "\n");<BR/> return foo;<BR/> }<BR/><BR/>})();<BR/><BR/>// 0.0.1 Initial release.<BR/>// 0.0.2 Changed script from rewriting the anchors to point to the stream to actually usin CNN's video player but forwarding past the ads.<BR/>// 0.0.3 Added support for both linking directly to the stream or using cnn's video player. <BR/>// 0.0.4 CNN Player has changed the structure of website on Jun 28 2007Duc Danghttps://www.blogger.com/profile/14522319168060297934noreply@blogger.com