Changeset 7642
- Timestamp:
- 03/08/08 02:17:55 (5 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
lang/javascript/userscripts/sharetwitteronhatenadiary.user.js
r7632 r7642 4 4 // @description Share Twitter conversation on Hatena Diary s***s 5 5 // @include http://twitter.com/* 6 // @include https://twitter.com/* 6 7 // @include http://twitter.1x1.jp/search/* 7 8 // @include http://terraminds.com/twitter/* … … 9 10 10 11 // this script require Minibuffer.user.js and LDRize.user.js. 11 // 12 // 12 13 // How to use: 13 14 // 1. access http://twitter.com/home … … 17 18 // 5. type "pinned-or-current-link | share-twitter-on-tumblr" ( not need " ) and Enter 18 19 // 6. access your tumblr. status you pinned will be listed. 19 // 20 // 20 21 21 22 (function(){ … … 35 36 var xsl = (new DOMParser()).parseFromString( 36 37 '<?xml version="1.0"?>\ 37 <stylesheet version="1.0" xmlns="http://www.w3.org/1999/XSL/Transform">\38 <stylesheet version="1.0" xmlns="http://www.w3.org/1999/XSL/Transform">\ 38 39 <output method="html"/>\ 39 40 </stylesheet>', "text/xml"); … … 69 70 var name = aURL.match('https?://twitter\\.com/([^/]+)')[1]; 70 71 var ago = $X('id("permalink")//span[@class="meta"]/text()[1]', doc, String); 71 72 72 73 return { 73 74 name: name, … … 75 76 permalink: aURL, 76 77 // FIXME: normalizeText() something wrong for this script. 77 ago: ago[0].nodeValue.replace(/^\s*/, '').replace(/\s*$/, '') 78 .replace(/\s+/g, ' ').replace(/from/, '') 78 ago: ago[0].nodeValue.replace(/^\s+|\s+$|from/g, '').replace(/\s+/g, ' '); 79 79 }; 80 80 } … … 86 86 return ref; 87 87 } else { 88 if ( ref .match( /^\// )) {89 return base. replace( /^(\w+:\/\/[^\/]+)/, '$1' )+ ref;88 if ( ref[0] == "/" ) { 89 return base.match( /^\w+:\/\/[^\/]+/ )[0] + ref; 90 90 } else { 91 return base.replace( / ([^\/]*)$/, '' ) + ref.replace(/^\.\//, '');91 return base.replace( /[^\/]+$/, '' ) + ref.replace(/^\.\//, ''); 92 92 } 93 93 } … … 102 102 click: function (name) { 103 103 var data = {}; 104 var inputTypeSubmit = null; 104 var inputTypeSubmit = null; 105 105 if ( name ) { 106 106 inputTypeSubmit = self[name];
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)