Changeset 7642

Show
Ignore:
Timestamp:
03/08/08 02:17:55 (5 years ago)
Author:
drry
Message:

lang/javascript/userscripts/sharetwitteronhatenadiary.user.js:

  • resolveLink() を修正しました。(多分)
  • @include に HTTPS URL を追加しました。
  • ほか。
Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lang/javascript/userscripts/sharetwitteronhatenadiary.user.js

    r7632 r7642  
    44// @description    Share Twitter conversation on Hatena Diary s***s 
    55// @include        http://twitter.com/* 
     6// @include        https://twitter.com/* 
    67// @include        http://twitter.1x1.jp/search/* 
    78// @include        http://terraminds.com/twitter/* 
     
    910 
    1011// this script require Minibuffer.user.js and LDRize.user.js. 
    11 //  
     12// 
    1213// How to use: 
    1314//  1. access http://twitter.com/home 
     
    1718//  5. type "pinned-or-current-link | share-twitter-on-tumblr" ( not need " ) and Enter 
    1819//  6. access your tumblr. status you pinned will be listed. 
    19 //  
     20// 
    2021 
    2122(function(){ 
     
    3536        var xsl = (new DOMParser()).parseFromString( 
    3637                '<?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">\ 
    3839                                <output method="html"/>\ 
    3940                        </stylesheet>', "text/xml"); 
     
    6970        var name = aURL.match('https?://twitter\\.com/([^/]+)')[1]; 
    7071        var ago = $X('id("permalink")//span[@class="meta"]/text()[1]', doc, String); 
    71          
     72 
    7273        return { 
    7374                name: name, 
     
    7576                  permalink: aURL, 
    7677                  // 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, ' '); 
    7979        }; 
    8080} 
     
    8686                        return ref; 
    8787                } else { 
    88                         if ( ref.match( /^\// ) ) { 
    89                                 return base.replace( /^(\w+:\/\/[^\/]+)/, '$1' ) + ref; 
     88                        if ( ref[0] == "/" ) { 
     89                                return base.match( /^\w+:\/\/[^\/]+/ )[0] + ref; 
    9090                        } else { 
    91                                 return base.replace( /([^\/]*)$/, '' ) + ref.replace(/^\.\//, ''); 
     91                                return base.replace( /[^\/]+$/, '' ) + ref.replace(/^\.\//, ''); 
    9292                        } 
    9393                } 
     
    102102                        click: function (name) { 
    103103                                var data = {}; 
    104                                 var inputTypeSubmit = null;  
     104                                var inputTypeSubmit = null; 
    105105                                if ( name ) { 
    106106                                        inputTypeSubmit = self[name];