Skip to content

Instantly share code, notes, and snippets.

@capoferro
Created January 29, 2014 17:52
Show Gist options
  • Save capoferro/8693241 to your computer and use it in GitHub Desktop.
Save capoferro/8693241 to your computer and use it in GitHub Desktop.
javascript:(function() { if (window.location.host != "www.wowhead.com" && window.location.host != "wowhead.com") { alert("This is a bookmarklet that works on wowhead.com. Drag this link to your bookmarks bar. Navigate to an item's wowhead page and click the bookmarklet on your bar. This will automatically add the item to your list."); return false; } var bookmarklet_data = {"PlayerName":"Krahl","BaseUrl":"http://loot.reforged.net"}; var player = encodeURIComponent(bookmarklet_data.PlayerName); var url = encodeURIComponent(window.location.href); var dropped_by_element = $(".whtt-droppedby"); var dropped_by_string = ""; if (dropped_by_element.length == 0) { var dropped_by_element = $("#tab-dropped-by tbody.clickable a:first"); if (dropped_by_element.length == 0) { var dropped_by_element = $("#tab-contained-in-object tbody.clickable a:first"); } dropped_by_string = dropped_by_element.html() } else { dropped_by_string = dropped_by_element.html().replace("Dropped by: ", ""); } if (dropped_by_element.length == 0) { alert("This page does not define who (or what) drops this item. Yell at Capo if you think this is an error."); return false; } var boss = encodeURIComponent(dropped_by_string); window.open(bookmarklet_data.BaseUrl + "/bookmarklet_add?wowhead_url=" + url + "&player=" + player + "&boss=" + boss, "_blank"); })()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment