Skip to content

Instantly share code, notes, and snippets.

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