Changeset 9661
- Timestamp:
- 04/18/08 06:18:53 (4 months ago)
- Files:
-
- 1 modified
-
lang/javascript/userscripts/matanicovideo.user.js (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lang/javascript/userscripts/matanicovideo.user.js
r9647 r9661 18 18 }; 19 19 20 var h1 = document.getElementsByTagName('h1') [0];20 var h1 = document.getElementsByTagName('h1').item(0); 21 21 if(!h1) return; 22 22 var span = document.createElement('span'); … … 24 24 25 25 var a = document.createElement('a'); 26 a.appendChild(document.createTextNode('[\u307 e\u305f\u898b\u3066\u308b]'));27 a.href = 'javascript:void (0);';26 a.appendChild(document.createTextNode('[\u307E\u305F\u898B\u3066\u308B]')); 27 a.href = 'javascript:void 0'; 28 28 a.addEventListener('click', 29 29 function(){ … … 37 37 38 38 var a = document.createElement('a'); 39 a.appendChild(document.createTextNode('[\u307 e\u305f\u898b\u3066\u308b!]'));40 a.href = 'javascript:void (0);';39 a.appendChild(document.createTextNode('[\u307E\u305F\u898B\u3066\u308B!]')); 40 a.href = 'javascript:void 0'; 41 41 a.addEventListener('click', 42 42 function(){ … … 44 44 var script = document.createElement('script'); 45 45 script.setAttribute('src', 'http://twitter.com/account/verify_credentials.json?callback=matanicovideo_callback'); 46 script.setAttribute('type', ' text/javascript');46 script.setAttribute('type', 'application/javascript'); 47 47 script.setAttribute('charset', 'utf-8'); 48 48 script.addEventListener('load', function(){ 49 var subject = h1. getElementsByTagName('a')[0].innerHTML;49 var subject = h1.textContent; 50 50 var url = location.href; 51 51 52 var len = document.getElementById('flvplayer').wrappedJSObject.GetVariable('ContentLength') ;52 var len = document.getElementById('flvplayer').wrappedJSObject.GetVariable('ContentLength').replace(/\D+/g, ''); 53 53 var lmin = Math.floor(len / 60); 54 54 var lsec = len % 60; … … 57 57 method: 'POST', 58 58 url: 'http://twitter.com/statuses/update.json', 59 headers: { 'Content- type': 'application/x-www-form-urlencoded' },59 headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, 60 60 data: 'status=' + encodeURIComponent( 61 '\u307e\u305f\u30cb\u30b3\u30cb\u30b3\u52d5\u753b\u898b\u3066\u308b : ' + 62 subject + ' ' + url + ' (' + lmin.z(2) + ':' + lsec.z(2) + ')' + 61 '\u307E\u305F\u30CB\u30B3\u30CB\u30B3\u52D5\u753B\u898B\u3066\u308B : ' + 62 subject + ' ' + url + 63 ' (' + (0 < len ? lmin.z(2) : '--') + ':' + (0 < len ? lsec.z(2) : '--') + ')' + 63 64 ((0 < text.value.length) ? ' ' + text.value : '') 64 65 ), 65 onload: function(res){ GM_log('\u6295\u7 a3f\u3057\u307e\u3057\u305f\u3002'); },66 onload: function(res){ GM_log('\u6295\u7A3F\u3057\u307E\u3057\u305F\u3002'); }, 66 67 onerror: function(res){ GM_log(res.status + ':' + res.statusText); } 67 68 }); 68 69 a.parentNode.parentNode.removeChild(a.parentNode); 69 70 }, false); 70 document. getElementsByTagName('head')[0].appendChild(script);71 document.documentElement.appendChild(script); 71 72 }, false); 72 73 span.appendChild(a);
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)