良い wayspots copy

    @@ -19,4 +19,5 @@ textarea.select(); document.execCommand('copy'); textarea.remove(); +alert(title + 'のWayspot情報をクリップボードにコピーしました') })()
  • /*
     * @title 良い wayspots copy
     * @description my bookmarklet
     * @include http://*
     * @license MIT License
     * @require 
     * @javascript_url 
     */
    (function(){
    var title = document.getElementsByClassName('showcase-item__title')[0].childNodes[0].textContent;
    var addr = document.getElementsByClassName('showcase-item__address')[0].childNodes[0].textContent;
    var map = document.getElementsByClassName('showcase-item__map')[0].childNodes[0].childNodes[0].attributes.getNamedItem('style').value;
    var latlng = new RegExp(/\d+\.\d+/, 'g');
    msg=title + '\n' + addr + '\n' + 'https://intel.ingress.com/intel?pll=' + latlng.exec(map)[0] + ',' + latlng.exec(map)[0];
    
    const textarea = document.createElement('textarea');
    textarea.textContent = msg;
    document.body.appendChild(textarea);
    textarea.select();
    document.execCommand('copy');
    textarea.remove();
    alert(title + 'のWayspot情報をクリップボードにコピーしました')
    })()
  • Permalink
    このページへの個別リンクです。
    RAW
    書かれたコードへの直接のリンクです。
    Packed
    文字列が圧縮された書かれたコードへのリンクです。
    Userscript
    Greasemonkey 等で利用する場合の .user.js へのリンクです。
    Loader
    @require やソースコードが長い場合に多段ロードする Loader コミのコードへのリンクです。
    Metadata
    コード中にコメントで @xxx と書かれたメタデータの JSON です。