Skip to content

Instantly share code, notes, and snippets.

@ttscoff
Last active December 11, 2015 02:19
Show Gist options
  • Save ttscoff/4529952 to your computer and use it in GitHub Desktop.
Save ttscoff/4529952 to your computer and use it in GitHub Desktop.
Browser bookmarklet which generates a Markdown list of all the show links on a 5by5 episode page, autoselects the result for copying and provides next/prev navigation
javascript:(function(){var%20output%3D%22%5Cn%5Cn%23%23%23%20%5BEpisode%20%22%2Bwindow.location.href.replace(%2F.*%5C%2F(%5Cd)%2F%2C%22%241%22)%2B%22%5D(%22%2Bwindow.location.href%2B%22)%5Cn%5Cn%22%3B%24(%22%23episode_links%22).find(%22a%22).each(function()%7Boutput%2B%3D%22*%20%5B%22%2B%24(this).text()%2B%22%5D(%22%2B%24(this).attr(%22href%22)%2B%22)%5Cn%22%7D)%3Bvar%20ep%3DparseInt(window.location.href.match(%2F(%5Cd%2B)%24%2F)%5B0%5D%2C10)%3Bvar%20nextLink%3D%24(%22%3Ca%3E%22).attr(%22href%22%2Cwindow.location.href.replace(%2F%5Cd%2B%24%2F%2Cep%2B1)).text(%22Next%20Episode%22).css(%7Bdisplay%3A%22block%22%2Cpadding%3A%2210px%22%2CtextAlign%3A%22center%22%2CbackgroundColor%3A%22%23ddd%22%2C%22float%22%3A%22right%22%7D)%3Bvar%20prevLink%3D%24(%22%3Ca%3E%22).attr(%22href%22%2Cwindow.location.href.replace(%2F%5Cd%2B%24%2F%2Cep-1)).text(%22Previous%20Episode%22).css(%7Bdisplay%3A%22block%22%2Cpadding%3A%2210px%22%2CtextAlign%3A%22center%22%2CbackgroundColor%3A%22%23ddd%22%2C%22float%22%3A%22left%22%7D)%3B%24(%22%3Cdiv%3E%22).css(%7Bposition%3A%22fixed%22%2Ctop%3A%220%22%2Cleft%3A%220%22%2Cright%3A%220%22%2Cbottom%3A%220%22%2Coverflow%3A%22auto%22%2CbackgroundColor%3A%22%23efefef%22%2Ccolor%3A%22%23333%22%2CzIndex%3A%2299999%22%7D).append(%24('%3Cpre%20id%3D%22eplinkoutput%22%3E').css(%22padding%22%2C%2220px%22).text(output)).append(%24(%22%3Cdiv%3E%22).append(prevLink).append(nextLink)).appendTo(%22body%22)%3Bvar%20doc%3Ddocument%2Ctext%3Ddoc.getElementById(%22eplinkoutput%22)%2Crange%2Cselection%3Bif(doc.body.createTextRange)%7Brange%3Ddoc.body.createTextRange()%3Brange.moveToElementText(text)%3Brange.select()%7Delse%7Bif(window.getSelection)%7Bselection%3Dwindow.getSelection()%3Brange%3Ddoc.createRange()%3Brange.selectNodeContents(text)%3Bselection.removeAllRanges()%3Bselection.addRange(range)%7D%7D%3B}());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment