Last active
March 29, 2016 18:04
-
-
Save csilcock/17177d3b743b05ce6552cf0497568701 to your computer and use it in GitHub Desktop.
RabbitMQ UI Event Exporter Bookmarklet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let elems = document.getElementsByClassName('msg-payload'); let csv = ''; Array.prototype.forEach.call(elems, function(elem){csv += elem.innerText + ',\n'}); console.log(csv); let a = document.createElement('a'); a.href = 'data:attachment/csv,' + encodeURIComponent(csv); a.target = '_blank'; a.download = 'events.csv'; document.body.appendChild(a); a.click(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:(function()%7Blet%20elems%20%3D%20document.getElementsByClassName('msg-payload')%3B%20let%20csv%20%3D%20''%3B%20Array.prototype.forEach.call(elems%2C%20function(elem)%7Bcsv%20%2B%3D%20elem.innerText%20%2B%20'%2C%5Cn'%7D)%3B%20console.log(csv)%3B%20let%20a%20%3D%20document.createElement('a')%3B%20a.href%20%3D%20'data%3Aattachment%2Fcsv%2C'%20%2B%20%20encodeURIComponent(csv)%3B%20a.target%20%3D%20'_blank'%3B%20a.download%20%3D%20'events.csv'%3B%20document.body.appendChild(a)%3B%20a.click()%7D)() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-- Chris.