<?xml version="1.0" encoding="UTF-8"?>
<post>
  <body>This should work as a base for those with more skill to build upon:

&lt;code&gt;
/*
	==UserScript==
	@name            StumbleVideo HTML Displayer
	@include         http://video.stumbleupon.com/*
	@description     Displays the &quot;Embed&quot; HTML code when watching videos on http://video.stumbleupon.com/.
	==/UserScript==
*/

(function(){
	function $(id){ return document.getElementById(id); }
	
	function getCode()
	{
		var video = $('mymovie');
		if (!video){ return ''; }
		var src = video.getAttribute('src');
		
		var html = '&lt;embed ';
		html += 'src=' + '&quot;' + src + '&quot;';
		html += ' type=&quot;application/x-shockwave-flash&quot;';
		html += ' /&gt;';
		
		return html;
	}
	
	var codeHolder = document.createElement('textarea');
	codeHolder.style.width = '100%'; // Narrow textareas aren't very useful for this purpose.
	codeHolder.setAttribute('rows', '3'); // Make it tall enough to display full codes without having to scroll.
	
	$('brdM').appendChild(codeHolder); // Put the code holder below everything in the video area.
	
	showCode(); // Go ahead and show the code of the currently playing video.
	
	function showCode(){ codeHolder.value = getCode(); }
	
	document.addEventListener(
		'click',
		function()
		{
			setTimeout(showCode, 1000); // Give a little time for the video to change. If site takes longer, script doesn't switch code.
		},
		false
	);
})();
&lt;/code&gt;

It won't work if the site takes longer than 1 second to switch videos. Can be somewhat fixed by increased the timeout length.</body>
  <body-html>&lt;p&gt;This should work as a base for those with more skill to build upon:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;
&lt;br /&gt;/*
&lt;br /&gt;	==UserScript==
&lt;br /&gt;	@name            StumbleVideo HTML Displayer
&lt;br /&gt;	@include         http://video.stumbleupon.com/*
&lt;br /&gt;	@description     Displays the &quot;Embed&quot; HTML code when watching videos on http://video.stumbleupon.com/.
&lt;br /&gt;	==/UserScript==
&lt;br /&gt;*/&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;(function(){
&lt;br /&gt;	function $(id){ return document.getElementById(id); }
&lt;br /&gt;	
&lt;br /&gt;	function getCode()
&lt;br /&gt;	{
&lt;br /&gt;		var video = $('mymovie');
&lt;br /&gt;		if (!video){ return ''; }
&lt;br /&gt;		var src = video.getAttribute('src');
&lt;br /&gt;		
&lt;br /&gt;		var html = '&amp;lt;embed&gt;';
&lt;br /&gt;		
&lt;br /&gt;		return html;
&lt;br /&gt;	}
&lt;br /&gt;	
&lt;br /&gt;	var codeHolder = document.createElement('textarea');
&lt;br /&gt;	codeHolder.style.width = '100%'; // Narrow textareas aren't very useful for this purpose.
&lt;br /&gt;	codeHolder.setAttribute('rows', '3'); // Make it tall enough to display full codes without having to scroll.
&lt;br /&gt;	
&lt;br /&gt;	$('brdM').appendChild(codeHolder); // Put the code holder below everything in the video area.
&lt;br /&gt;	
&lt;br /&gt;	showCode(); // Go ahead and show the code of the currently playing video.
&lt;br /&gt;	
&lt;br /&gt;	function showCode(){ codeHolder.value = getCode(); }
&lt;br /&gt;	
&lt;br /&gt;	document.addEventListener(
&lt;br /&gt;		'click',
&lt;br /&gt;		function()
&lt;br /&gt;		{
&lt;br /&gt;			setTimeout(showCode, 1000); // Give a little time for the video to change. If site takes longer, script doesn't switch code.
&lt;br /&gt;		},
&lt;br /&gt;		false
&lt;br /&gt;	);
&lt;br /&gt;})();
&lt;br /&gt;&lt;/p&gt;

&lt;p&gt;It won't work if the site takes longer than 1 second to switch videos. Can be somewhat fixed by increased the timeout length.&lt;/p&gt;</body-html>
  <created-at type="datetime">2007-06-03T17:55:25Z</created-at>
  <forumable-id type="integer">2</forumable-id>
  <forumable-type>Forum</forumable-type>
  <id type="integer">2196</id>
  <topic-id type="integer">259</topic-id>
  <updated-at type="datetime">2008-05-25T06:12:48Z</updated-at>
  <user-agent nil="true"></user-agent>
  <user-id type="integer">28460</user-id>
</post>
