A listing of bookmarklet efforts at ZINE on GitHub
hタグ(h1, h2, h3, h4, h5)をハイライト表示します
javascript: (function(e){var o={log:{enabled:!1,welcome:!1},eval:'"!function(){[{color:\\"#F44336\\",selector:\\"h1\\"},{color:\\"#E91E63\\",selector:\\"h2\\"},{color:\\"#9C27B0\\",selector:\\"h3\\"},{color:\\"#673AB7\\",selector:\\"h4\\"},{color:\\"#3F51B5\\",selector:\\"h5\\"},{color:\\"#2196F3\\",selector:\\"h6\\"}].map(function(o){for(var e=document.querySelectorAll(o.selector),r=0,l=e.length;l>r;++r){var c=e[r];c.style.backgroundColor=o.color;var t=document.createElement(\\"span\\");t.innerHTML=\\" | \\"+o.selector,c.appendChild(t)}})}();"'},t=!0;if("object"==typeof this.artoo&&(artoo.settings.reload||(artoo.log.verbose("artoo already exists within this page. No need to inject him again."),artoo.loadSettings(o),artoo.exec(),t=!1)),t){var r=document.getElementsByTagName("body")[0];r||(r=document.createElement("body"),document.documentElement.appendChild(r));var l=document.createElement("script");console.log("Loading..."),l.src="//medialab.github.io/artoo/public/dist/artoo-latest.min.js",l.type="text/javascript",l.id="artoo_injected_script",l.setAttribute("settings",JSON.stringify(o)),r.appendChild(l)}}).call(this);
食べログ「行った・行きたい」をCSV出力します
- visit http://tabelog.com/bookmark/
- run
javascript: (function(t){var e={log:{enabled:!1,welcome:!1},eval:'"!function(t){\\"use strict\\";function e(t,e){if(\\"object\\"!=typeof t&&(t=new Date(t)),e||(e=\\"YYYY-MM-DD hh:mm:ss.SSS\\"),e=e.replace(/YYYY/g,t.getFullYear()),e=e.replace(/MM/g,(\\"0\\"+(t.getMonth()+1)).slice(-2)),e=e.replace(/DD/g,(\\"0\\"+t.getDate()).slice(-2)),e=e.replace(/hh/g,(\\"0\\"+t.getHours()).slice(-2)),e=e.replace(/mm/g,(\\"0\\"+t.getMinutes()).slice(-2)),e=e.replace(/ss/g,(\\"0\\"+t.getSeconds()).slice(-2)),e.match(/S/g))for(var o=(\\"00\\"+t.getMilliseconds()).slice(-3),n=e.match(/S/g).length,r=0;n>r;r++)e=e.replace(/S/,o.substring(r,r+1));return e}var o={modal:\\"#___modal\\",filename:\\"tabelog_bookmark_\\"+e(new Date,\\"YYYYMMDD\\")},n=function(t){this.opts=t,this.currentPage=1,this.bookmarks=[],this.$modal=void 0,this.nextUrl=void 0};n.prototype[\\"export\\"]=function(){if(window.confirm(\\"食べログ「行った・行きたい」をエクスポートします\\")){var t=this;t.$modal=t.showModal(),t.crawl()}},n.prototype.crawl=function(){var t=this;t.$modal.text(\\"読み込み中... / \\"+t.currentPage+\\"ページ目\\"),t.paging().then(function(e){return t.nextUrl=t.getNextUrl(e),t.load(e)}).done(function(){t.nextUrl?(t.currentPage++,t.crawl()):(alert(\\"エクスポート完了: \\"+t.bookmarks.length+\\"件\\\\n\\\\n続いてダウンロードされるCSVをGoogleマイマップからインポートしてください\\\\nhttps://www.google.com/mymaps\\"),t.hideModal())}).fail(function(){alert(\\"読み込みに失敗しました :(\\"),t.hideModal()})},n.prototype.paging=function(){var e=this,o=t.Deferred();return 1===e.currentPage?o.resolve(t(\\"html\\")):t.ajax({url:e.nextUrl,dataType:\\"html\\"}).done(function(e){o.resolve(t(e))}).fail(function(){o.reject()}),o.promise()},n.prototype.load=function(e){var o=this,n=o.getEntries(e);return t.when.apply(t,n.map(function(e){return t.ajax({url:e,dataType:\\"html\\"}).done(function(n){o.extract(e,t(n))})}))},n.prototype.extract=function(t,e){var o=this,n={},r=e.find(\\"#headline h1\\").text().trim().split(\\" - \\");n.name=r[0],n.areaCategory=r[1],n.address=e.find(\\"#rstdata-wrap .address td > p\\").text().trim(),n.rating=e.find(\\"#rdhead-detail .score span\\").text().trim(),n.tel=e.find(\\"#visit-action-wrap .tel\\").text().trim(),n.url=t,o.bookmarks.push(n),console.log(n)},n.prototype.getEntries=function(e){var o=[];return e.find(\\".js-bookmark\\").each(function(){var e=t(this).find(\\".js-rstname a\\").attr(\\"href\\")||t(this).find(\\".bm-rstname a\\").attr(\\"href\\");o.push(e)}),o},n.prototype.getNextUrl=function(t){var e=t.find(\\".page-move__target--next\\");return e.length>0?e.attr(\\"href\\"):!1},n.prototype.showModal=function(){return 0===t(this.opts.modal).length&&t(\\"<div/>\\").attr(\\"id\\",this.opts.modal.replace(\\"#\\",\\"\\")).css({position:\\"fixed\\",left:0,top:0,width:\\"100%\\",height:\\"100%\\",zIndex:9999,backgroundColor:\\"rgba(0, 0, 0, .7)\\",color:\\"#fff\\",fontSize:30,textAlign:\\"center\\",paddingTop:\\"15em\\"}).appendTo(\\"body\\"),t(this.opts.modal)},n.prototype.hideModal=function(){this.downloadCsv(this.createCsv(this.bookmarks)),this.$modal.remove()},n.prototype.createCsv=function(t){return\'\\"お店\\",\\"エリア\\",\\"住所\\",\\"点数\\",\\"TEL\\",\\"URL\\"\\\\n\'+t.map(function(t){return Object.keys(t).map(function(e){return\'\\"\'+t[e]+\'\\"\'}).join(\\",\\")}).join(\\"\\\\n\\")},n.prototype.downloadCsv=function(t){var e=\\"data:text/csv,\\"+encodeURIComponent(t),o=document.createElement(\\"a\\");o.download=this.opts.filename,o.href=e,document.body.appendChild(o),o.click(),document.body.removeChild(o)},new n(o)[\\"export\\"]()}(artoo.$);"'},o=!0;if("object"==typeof this.artoo&&(artoo.settings.reload||(artoo.log.verbose("artoo already exists within this page. No need to inject him again."),artoo.loadSettings(e),artoo.exec(),o=!1)),o){var n=document.getElementsByTagName("body")[0];n||(n=document.createElement("body"),document.documentElement.appendChild(n));var r=document.createElement("script");r.src="//medialab.github.io/artoo/public/dist/artoo-latest.min.js",r.type="text/javascript",r.id="artoo_injected_script",r.setAttribute("settings",JSON.stringify(e)),n.appendChild(r)}}).call(this);
ページ内のテキストをセーフサーチで確認します
javascript: (function(t){var e={log:{enabled:!1,welcome:!1},eval:'"!function(e){\\"use strict\\";var t=function(){this.documents=document.body.innerText,this.start()};t.prototype.start=function(){var e=this,t=e.fetchGoogleSpreadSheet();t.done(function(t){var n=t.map(function(e){return e.content.$t});e.crawl(n)}),t.fail(function(){alert(\\"Oops :(\\")})},t.prototype.crawl=function(e){var t=this,n=e.filter(function(e){return-1!==t.documents.indexOf(e)});alert(n.length>0?n.join(\\", \\"):\\"OK!\\")},t.prototype.fetchGoogleSpreadSheet=function(){var t=e.Deferred(),n={url:\\"//spreadsheets.google.com/feeds/cells/195SSJA5tG9VwDeq20uuzOb35txQbHdby8S9hT6yBhF0/od6/public/values?alt=json\\",cache:!1,dataType:\\"json\\"};return e.ajax(n).done(function(e,n,o){t.resolve(e.feed.entry)}).fail(function(e,n,o){t.reject()}),t.promise()},new t}(artoo.$);"'},o=!0;if("object"==typeof this.artoo&&(artoo.settings.reload||(artoo.log.verbose("artoo already exists within this page. No need to inject him again."),artoo.loadSettings(e),artoo.exec(),o=!1)),o){var n=document.getElementsByTagName("body")[0];n||(n=document.createElement("body"),document.documentElement.appendChild(n));var a=document.createElement("script");a.src="//medialab.github.io/artoo/public/dist/artoo-latest.min.js",a.type="text/javascript",a.id="artoo_injected_script",a.setAttribute("settings",JSON.stringify(e)),n.appendChild(a)}}).call(this);