Changeset 7436 for websites/ustreamer
- Timestamp:
- 03/04/08 00:26:51 (5 years ago)
- Location:
- websites/ustreamer
- Files:
-
- 4 modified
-
channel2json.cgi (modified) (4 diffs)
-
index.html (modified) (1 diff)
-
js/ustreamer.js (modified) (7 diffs)
-
onairstatus2json.cgi (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
websites/ustreamer/channel2json.cgi
r7010 r7436 25 25 26 26 my %scraper = ( 27 'usc' => qr{src="http:// ustream\.tv/([^"]*?)\.usc"}o,27 'usc' => qr{src="http://(?:www\.)?ustream\.tv/([^"]*?)\.usc"}o, 28 28 'irc' => qr{chat_so\.addVariable\('channel', '#([^']*?)'\);}o 29 29 ); … … 38 38 39 39 my %result = map { 40 $_ => channel2any($_, $mode) 40 $_ => channel2any($_, $mode) 41 41 } map { 42 $_ =~ s{http://(?:www\.)?ustream.tv/channel/}{}; $_ 42 $_ =~ s{http://(?:www\.)?ustream.tv/channel/}{}; $_ 43 43 } @channels; 44 44 … … 57 57 my $ua = LWP::UserAgent->new; 58 58 $ua->agent('ustream2json/0.01'); 59 59 60 60 my $res = URI::Fetch->fetch( 61 61 $url, … … 72 72 my ($q, $obj) = @_; 73 73 print $q->header( 74 "-type" => " text/javascript",74 "-type" => "application/json", 75 75 "-charset" => 'utf-8' 76 76 ); -
websites/ustreamer/index.html
r303 r7436 47 47 <div style="clear: both;"></div> 48 48 49 <form onsubmit="if (this.url.value) { addBuddyFromURL('http:// ustream.tv/channel/'+this.url.value) } return false">50 add Channel: http:// ustream.tv/channel/<input size="30" name="url" value="" type="text" onfocus="this.select()"> <input value="add" type="submit">49 <form onsubmit="if (this.url.value) { addBuddyFromURL('http://www.ustream.tv/channel/'+this.url.value) } return false"> 50 add Channel: http://www.ustream.tv/channel/<input size="30" name="url" value="" type="text" onfocus="this.select()"> <input value="add" type="submit"> 51 51 </form> 52 52 <textarea id="linkcode" cols="30" rows="1" style="width:100%;height:1.5em;overflow:hidden" onfocus="this.select()"> </textarea> -
websites/ustreamer/js/ustreamer.js
r4240 r7436 8 8 var init_load_limit = 3; 9 9 10 var use_innerhtml = (navigator.userAgent.match(/Safari/) || window.opera) ? true : false;10 var use_innerhtml = navigator.userAgent.indexOf("Safari") != -1 || window.opera; 11 11 var buddies = []; 12 12 var buddyEmbeds = []; … … 114 114 // IRC 115 115 if (use_innerhtml) { 116 container.innerHTML = ['<embed ', ' width="', current_width, '"', ' height="200"', ' type="application/x-shockwave-flash" ', ' flashvars="channel=#', buddy.name, '" ', ' src="http:// ustream.tv/IrcClient.swf" ', ' title="', buddy.name, '"/>'].join("");116 container.innerHTML = ['<embed ', ' width="', current_width, '"', ' height="200"', ' type="application/x-shockwave-flash" ', ' flashvars="channel=#', buddy.name, '" ', ' src="http://www.ustream.tv/IrcClient.swf" ', ' title="', buddy.name, '"/>'].join(""); 117 117 } 118 118 else { … … 120 120 el.width = current_width; 121 121 el.height = 200; 122 el.src = "http:// ustream.tv/IrcClient.swf";122 el.src = "http://www.ustream.tv/IrcClient.swf"; 123 123 el.type = "application/x-shockwave-flash"; 124 124 el.wmode = "transparent"; … … 130 130 caption = document.createElement('div'); 131 131 caption.className = "caption"; 132 caption.innerHTML = "<a href='http:// ustream.tv/watch/channel/" + buddy.id + "' target=_blank>" + buddy.name + '</a> ';132 caption.innerHTML = "<a href='http://www.ustream.tv/watch/channel/" + buddy.id + "' target=_blank>" + buddy.name + '</a> '; 133 133 container.appendChild(caption); 134 134 return container; … … 158 158 function addBuddyFromURL(url) { 159 159 var api = path_to_api + '?channel_name='; 160 var channel_name = url.replace(/http:\/\/( www\.)?ustream.tv\/channel\//, "");160 var channel_name = url.replace(/http:\/\/(?:www\.)?ustream\.tv\/channel\//, ""); 161 161 if (document.getElementsByName(channel_name)[0]) { 162 162 return; … … 189 189 addNewEmbed({ name : target.getAttribute("name"), id : id }); 190 190 if ( target.childNodes[0].alt.match(/^other-(.*)/)) { 191 addBuddyFromURL("http:// ustream.tv/channel/" + RegExp.$1);191 addBuddyFromURL("http://www.ustream.tv/channel/" + RegExp.$1); 192 192 } 193 193 } … … 338 338 var ticker = document.getElementById("ticker"); 339 339 var entryContent = entryContents[count]; 340 channelURLs = entryContent.match(/http:\/\/( www\.)?ustream.tv\/channel\/([0-9a-zA-Z_-]*)/);340 channelURLs = entryContent.match(/http:\/\/(?:www\.)?ustream\.tv\/channel\/([0-9a-zA-Z_-]+)/); 341 341 if (channelURLs) { 342 342 channelURL = channelURLs[0]; 343 channelName = channelURLs[ 2];343 channelName = channelURLs[1]; 344 344 } 345 345 message += entryContent.charAt(count++); -
websites/ustreamer/onairstatus2json.cgi
r141 r7436 36 36 37 37 my %result = map { 38 $_ => onair($_) 38 $_ => onair($_) 39 39 } map { 40 $_=~s{http://www.ustream.tv/channel/}{}; $_ 40 $_=~s{http://www.ustream.tv/channel/}{}; $_ 41 41 } @channels; 42 42 … … 49 49 my $ua = LWP::UserAgent->new; 50 50 $ua->agent('onairstatus2json/0.01'); 51 51 52 52 my $res = URI::Fetch->fetch( 53 53 $url, … … 75 75 my $ua = LWP::UserAgent->new; 76 76 $ua->agent('onairstatus2json/0.01'); 77 77 78 78 my $res = URI::Fetch->fetch( 79 79 $url, … … 92 92 my ($q, $obj) = @_; 93 93 print $q->header( 94 "-type" => " text/javascript",94 "-type" => "application/json", 95 95 "-charset" => 'utf-8' 96 96 );
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)