Skip to content

Instantly share code, notes, and snippets.

View mokkunp's full-sized avatar

mokkun mokkunp

  • tehepero, Inc.
  • Tokyo
View GitHub Profile
@mokkunp
mokkunp / bookmarklet.md
Last active June 27, 2017 02:46
Amazonのページからscrapboxの読書ページを作るブックマークレット

https://scrapbox.io/xxxxxxxxxx/の部分を自分のプロジェクトに変えて使って下さい

javascript: (function() { var title = document.getElementById("ebooksProductTitle");if(title == null){ title = document.getElementById("productTitle")};title = title.innerText;  var imageUrl = document.getElementById("ebooksImgBlkFront");if(imageUrl == null) {imageUrl = document.getElementById("imgBlkFront")};imageUrl = imageUrl.src;var author = document.getElementById("byline").innerText;location.href ="https://scrapbox.io/xxxxxxxxxx/" + encodeURIComponent(title) + "?body=" + encodeURIComponent(author + "\n[" + imageUrl + "]\n\n" + location.origin + location.pathname.match(/\/dp\/[^/]+/)[0] + "\n\n#book")})()
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')