Changes between Version 9 and Version 10 of Dev/nicovideo


Ignore:
Timestamp:
Dec 23, 2016 12:09:11 PM (7 years ago)
Author:
mitty
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Dev/nicovideo

    v9 v10  
    88 > ニコニコ生放送のコメントを取得するには、まず、プレミアム会員でなければなりません。 
    99 > 通常の会員では、1000件程度が上限となります。 
     10 
     11 * [http://d.hatena.ne.jp/ino46/20110320/1300555752 ニコニコ生放送の予定をGoogleカレンダーに登録するブックマークレット - 何にしても生っかじりの朴念仁] 
     12 > {{{#!javascript 
     13 > javascript:(function(){try{var c=document,a,b,d;d=location.toString();if(d.indexOf("http://live.nicovideo.jp/watch/lv")!=0&&d.indexOf("http://live.nicovideo.jp/gate/lv")!=0)throw"This URL is not supported";String.prototype.trim=function(){return this.replace(/^\s*|\s*$/g,"")};a=c.querySelector("div.infobox > h2").textContent.trim();b=c.querySelector("div.kaijo").textContent.trim();if(!a[0]||!a[1]||!b)throw"Cannot get enough info";a=a.split("\n");a[1]=a[1].trim().replace(/^\(|\)$/g,"");b=b.replace(/[^\d]/g,"");b=b.slice(0,8)+"T"+b.slice(8,12)+"00";window.open("https://www.google.com/calendar/render?action=TEMPLATE&text="+encodeURIComponent(a[0])+"&dates="+b+"/"+b+"&details="+encodeURIComponent(a[0]+"\n"+a[1]+"\n"+c.location.href),"_blank")}catch(e){alert("Error:\n"+e)}})(); 
     14 > }}} 
     15  * コニコ生放送の仕様が変わったのか、番組名がうまく拾えなくなっていたので修正+リファクタリングした 
     16{{{#!javascript 
     17javascript:(function(){try{var starttime,progname,url;url=location.toString();if(url.indexOf("http://live.nicovideo.jp/watch/lv")!=0&&url.indexOf("http://live.nicovideo.jp/gate/lv")!=0)throw"This URL is not supported";String.prototype.trim=function(){return this.replace(/^\s*|\s*$/g,"")};progname=document.title;starttime=document.querySelector("div.kaijo").textContent.trim();if(!progname||!starttime)throw"Cannot get enough info";progname.replace(/^\(|\)$/g,"");starttime=starttime.replace(/[^\d]/g,"");starttime=starttime.slice(0,8)+"T"+starttime.slice(8,12)+"00";window.open("https://www.google.com/calendar/render?action=TEMPLATE&text="+encodeURIComponent(progname)+"&dates="+starttime+"/"+starttime+"&details="+encodeURIComponent(progname+"\n\n"+document.location.href),"_blank")}catch(e){alert("Error:\n"+e)}})(); 
     18}}} 
    1019 
    1120 = getthumbinfo =