- Timestamp:
- 09/21/08 16:55:54 (2 months ago)
- Location:
- websites/ustreamer
- Files:
-
- 4 modified
-
channel2json.cgi (modified) (2 diffs)
-
css/ustreamer.css (modified) (1 diff)
-
js/ustreamer.js (modified) (8 diffs)
-
onairstatus2json.cgi (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
websites/ustreamer/channel2json.cgi
r15123 r19672 25 25 26 26 my %scraper = ( 27 'usc' => qr{ <p(?:\s[^>]*)?><a(?:\s[^>]*?)?\shref="/(\d+)\.usc"}o,28 'irc' => qr{chat_so\.addVariable\('channel', '#([^'] *?)'\);}o27 'usc' => qr{viewer_so\.addVariable\('cid', '(\d+)}o, 28 'irc' => qr{chat_so\.addVariable\('channel', '#([^']+)}o 29 29 ); 30 30 … … 77 77 my $json = JSON::Syck::Dump($obj); 78 78 if(defined (my $p = $q->param('callback'))){ 79 $json = "$p($json);" if($p =~ /[a-zA-Z0-9 \.\_\[\]]/);79 $json = "$p($json);" if($p =~ /[a-zA-Z0-9._\[\]]/); 80 80 } 81 81 print $json; -
websites/ustreamer/css/ustreamer.css
r141 r19672 1 A { text-decoration: none ;}1 A { text-decoration: none } 2 2 body,form,input,textarea { font-size: 14px } 3 .container { float: left; margin: 2px }4 .caption { font-size: 28px; font-fa limy: sans-serif; text-align: center; margin: 0; padding: 0 }5 .selector { float: left; border: solid 1px #ccc; margin: 1px; padding: 2px; cursor: pointer;}6 img.status-icon { vertical-align: middle; margin: 0px 2px ;}3 .container { float: left; margin: 2px } 4 .caption { font-size: 28px; font-family: sans-serif; text-align: center; margin: 0; padding: 0 } 5 .selector { float: left; border: 1px solid #ccc; margin: 1px; padding: 2px; cursor: pointer } 6 img.status-icon { vertical-align: middle; margin: 0px 2px } -
websites/ustreamer/js/ustreamer.js
r10142 r19672 1 1 var api_hostname = document.location.hostname; 2 // var ustreamer_dir = '/ustreamer';2 //var ustreamer_dir = '/ustreamer'; 3 3 var path_to_api = 'http://' + api_hostname + ustreamer_dir + '/channel2json.cgi'; 4 4 var path_to_onair_api = 'http://' + api_hostname + ustreamer_dir + '/onairstatus2json.cgi'; 5 // var default_channels = 'amn,shi3z-show,knnkandas-show';5 //var default_channels = 'amn,shi3z-show,knnkandas-show'; 6 6 var withIRC = false; 7 7 var current_width = 300; … … 34 34 35 35 function loadBuddies() { 36 for ( i = 0; i < buddies.length; i++) {36 for (var i = 0; i < buddies.length; i++) { 37 37 addNewSelector(buddies[i]); 38 38 if (i < init_load_limit) { … … 98 98 container.id = "buddy-" + buddy.id; 99 99 if (use_innerhtml) { 100 container.innerHTML = ['<embed ', ' width="', current_width, '"', ' height="', current_width * 163 / 200, '"', ' src="http://www.ustream.tv/ ', buddy.id, '.usc"', ' type="application/x-shockwave-flash"', ' title="', buddy.name, '"/>'].join("");100 container.innerHTML = ['<embed ', ' width="', current_width, '"', ' height="', current_width * 163 / 200, '"', ' src="http://www.ustream.tv/flash/live/', buddy.id, '"', ' type="application/x-shockwave-flash"', ' title="', buddy.name, '"/>'].join(""); 101 101 } 102 102 else { … … 104 104 el.width = current_width; 105 105 el.height = current_width * 163 / 200; 106 el.src = "http://www.ustream.tv/ " + buddy.id + ".usc";106 el.src = "http://www.ustream.tv/flash/live/" + buddy.id; 107 107 el.type = "application/x-shockwave-flash"; 108 108 el.wmode = "transparent"; … … 150 150 function resizeEmbed(width) { 151 151 var embeds = document.getElementsByTagName('embed'); 152 for ( i = 0; i < embeds.length; i++) {152 for (var i = 0; i < embeds.length; i++) { 153 153 embeds[i].style.width = width + "px"; 154 154 embeds[i].style.height = width * 163 / 200 + "px"; … … 239 239 done : function (args) { 240 240 if (typeof args == "object") { 241 for ( i = 0; i < checkbuddies.length; i++) {241 for (var i = 0; i < checkbuddies.length; i++) { 242 242 buddy = checkbuddies[i]; 243 243 if (args[buddy.name]) { … … 268 268 }; 269 269 new Ten.JSONP(api, callback, 'done'); 270 // } while(buddies_temp.length > 0);270 // } while(buddies_temp.length > 0); 271 271 } 272 272 … … 338 338 var ticker = document.getElementById("ticker"); 339 339 var entryContent = entryContents[count]; 340 channelURLs = entryContent.match(/http:\/\/(?:www\.)?ustream\.tv\/channel\/([ \w-]+)/);340 channelURLs = entryContent.match(/http:\/\/(?:www\.)?ustream\.tv\/channel\/([-\w]+)/); 341 341 if (channelURLs) { 342 342 channelURL = channelURLs[0]; -
websites/ustreamer/onairstatus2json.cgi
r15123 r19672 84 84 return undef unless $res->is_success; 85 85 my $content = $res->content; 86 $content =~m{<a href="/([^"] *?)"><strong>};86 $content =~m{<a href="/([^"]+)"><strong>}; 87 87 return $1 ? $1 : undef; 88 88 } … … 96 96 my $json = JSON::Syck::Dump($obj); 97 97 if(defined (my $p = $q->param('callback'))){ 98 $json = "$p($json);" if($p =~ /[a-zA-Z0-9 \.\_\[\]]/);98 $json = "$p($json);" if($p =~ /[a-zA-Z0-9._\[\]]/); 99 99 } 100 100 print $json;
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)