Skip to content

Instantly share code, notes, and snippets.

@ttscoff
Last active December 12, 2015 09:19
Show Gist options
  • Save ttscoff/4750183 to your computer and use it in GitHub Desktop.
Save ttscoff/4750183 to your computer and use it in GitHub Desktop.
Generates a Markdown list of all the show links for a 5by5 show. Start it on the page for the first episode. Click the results once to select all for copying.
javascript:(function(){var%20collection%20%3D%20%5B%5D%3B%0Avar%20page%20%3D%201%3B%0Awhile%20(page%20%3E%200)%20%7B%0A%09%24.ajax(%7B%0A%09%09%20async%3A%20false%2C%0A%09%09%20type%3A%20'GET'%2C%0A%09%09%20url%3A%20window.location.href.replace(%2F(%5Cd%2B)%24%2F%2Cpage)%2C%0A%09%09%20success%3A%20function(data)%20%7B%0A%09%09%20%09%24data%20%3D%20%24(data)%3B%0A%09%09%09var%20epTitle%20%3D%20%24data.find('%23episode%20h2').first().text()%3B%0A%09%09%09var%20output%20%3D%20'%23%23%23%20%23'%2Bpage%2B'%3A%20'%2BepTitle%2B%22%5Cn%5Cn%22%3B%0A%09%09%09output%20%2B%3D%20'%5B**%5BShow%20link%5D('%2Bwindow.location.href.replace(%2F%5Cd%2B%24%2F%2Cpage)%2B%22)**%5D%5Cn%5Cn%22%0A%09%09%09%24data.find('%23episode_links').find('a').each(function()%7B%20output%20%2B%3D%20%22*%20%5B%22%2B%24(this).text().replace(%2F%5C%7C%2Fg%2C'-').replace(%2F%5B%5C%5B%5C%5D%5D%5D%2Fg%2C'**')%2B%22%5D(%22%2B%24(this).attr('href')%2B%22)%5Cn%22%20%7D)%3B%0A%09%09%09collection.push(output)%3B%0A%09%09%09page%20%2B%3D%201%3B%0A%09%09%20%7D%2C%0A%09%09%20error%3A%20function(data)%20%7B%0A%09%09%09page%20%3D%20-1%3B%0A%09%09%20%7D%0A%09%7D)%3B%0A%7D%0A%24('%3Cdiv%3E').css(%7B%0A%09position%3A'fixed'%2C%0A%09top%3A%20'0'%2C%0A%09left%3A'0'%2C%0A%09right%3A'0'%2C%0A%09bottom%3A'0'%2C%0A%09overflow%3A'auto'%2C%0A%09backgroundColor%3A'%23efefef'%2C%0A%09color%3A'%23333'%2C%0A%09zIndex%3A'99999'%7D).append(%24('%3Cpre%20id%3D%22eplinkoutput%22%3E').css('padding'%2C'20px').text(collection.join(%22%5Cn%22))).appendTo('body')%0A%09.click(function()%20%7B%0A%09%09var%20doc%20%3D%20document%2C%20text%20%3D%20doc.getElementById('eplinkoutput')%2C%20range%2C%20selection%3B%0A%09%09if%20(doc.body.createTextRange)%20%7B%0A%09%09%09range%20%3D%20doc.body.createTextRange()%3B%0A%09%09%09range.moveToElementText(text)%3B%0A%09%09%09range.select()%3B%0A%09%09%7D%20else%20if%20(window.getSelection)%20%7B%0A%09%09%09selection%20%3D%20window.getSelection()%3B%0A%09%09%09range%20%3D%20doc.createRange()%3B%0A%09%09%09range.selectNodeContents(text)%3B%0A%09%09%09selection.removeAllRanges()%3B%0A%09%09%09selection.addRange(range)%3B%0A%09%09%7D%0A%09%7D)%3B%0A}());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment