Changeset 19672 for websites

Show
Ignore:
Timestamp:
09/21/08 16:55:54 (2 months ago)
Author:
drry
Message:
  • Ustream のリニューアルに対応しました。
Location:
websites/ustreamer
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • websites/ustreamer/channel2json.cgi

    r15123 r19672  
    2525 
    2626my %scraper = ( 
    27     'usc' => qr{<p(?:\s[^>]*)?><a(?:\s[^>]*?)?\shref="/(\d+)\.usc"}o, 
    28     'irc' => qr{chat_so\.addVariable\('channel', '#([^']*?)'\);}o 
     27    'usc' => qr{viewer_so\.addVariable\('cid', '(\d+)}o, 
     28    'irc' => qr{chat_so\.addVariable\('channel', '#([^']+)}o 
    2929); 
    3030 
     
    7777    my $json = JSON::Syck::Dump($obj); 
    7878    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._\[\]]/); 
    8080    } 
    8181    print $json; 
  • websites/ustreamer/css/ustreamer.css

    r141 r19672  
    1 A { text-decoration: none; } 
     1A { text-decoration: none } 
    22body,form,input,textarea { font-size: 14px } 
    3 .container { float:left; margin: 2px } 
    4 .caption { font-size: 28px; font-falimy: 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 } 
     6img.status-icon { vertical-align: middle; margin: 0px 2px } 
  • websites/ustreamer/js/ustreamer.js

    r10142 r19672  
    11var api_hostname = document.location.hostname; 
    2 // var ustreamer_dir = '/ustreamer'; 
     2//var ustreamer_dir = '/ustreamer'; 
    33var path_to_api = 'http://' + api_hostname + ustreamer_dir + '/channel2json.cgi'; 
    44var 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'; 
    66var withIRC = false; 
    77var current_width = 300; 
     
    3434 
    3535function loadBuddies() { 
    36   for (i = 0; i < buddies.length; i++) { 
     36  for (var i = 0; i < buddies.length; i++) { 
    3737    addNewSelector(buddies[i]); 
    3838    if (i < init_load_limit) { 
     
    9898    container.id = "buddy-" + buddy.id; 
    9999    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(""); 
    101101    } 
    102102    else { 
     
    104104      el.width = current_width; 
    105105      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; 
    107107      el.type = "application/x-shockwave-flash"; 
    108108      el.wmode = "transparent"; 
     
    150150function resizeEmbed(width) { 
    151151  var embeds = document.getElementsByTagName('embed'); 
    152   for (i = 0; i < embeds.length; i++) { 
     152  for (var i = 0; i < embeds.length; i++) { 
    153153    embeds[i].style.width = width + "px"; 
    154154    embeds[i].style.height = width * 163 / 200 + "px"; 
     
    239239    done : function (args) { 
    240240      if (typeof args == "object") { 
    241         for (i = 0; i < checkbuddies.length; i++) { 
     241        for (var i = 0; i < checkbuddies.length; i++) { 
    242242          buddy = checkbuddies[i]; 
    243243          if (args[buddy.name]) { 
     
    268268  }; 
    269269  new Ten.JSONP(api, callback, 'done'); 
    270   //   } while(buddies_temp.length > 0); 
     270  //  } while(buddies_temp.length > 0); 
    271271} 
    272272 
     
    338338  var ticker = document.getElementById("ticker"); 
    339339  var entryContent = entryContents[count]; 
    340   channelURLs = entryContent.match(/http:\/\/(?:www\.)?ustream\.tv\/channel\/([\w-]+)/); 
     340  channelURLs = entryContent.match(/http:\/\/(?:www\.)?ustream\.tv\/channel\/([-\w]+)/); 
    341341  if (channelURLs) { 
    342342    channelURL = channelURLs[0]; 
  • websites/ustreamer/onairstatus2json.cgi

    r15123 r19672  
    8484    return undef unless $res->is_success; 
    8585    my $content = $res->content; 
    86     $content =~m{<a href="/([^"]*?)"><strong>}; 
     86    $content =~m{<a href="/([^"]+)"><strong>}; 
    8787    return $1 ? $1 : undef; 
    8888} 
     
    9696    my $json = JSON::Syck::Dump($obj); 
    9797    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._\[\]]/); 
    9999    } 
    100100    print $json;