Last active
April 1, 2016 11:36
-
-
Save pachacamac/ce4ce71498152bf11b60a17b79152418 to your computer and use it in GitHub Desktop.
Number26 CSV Download Bookmarklet
This file contains hidden or 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(){ | |
| var delim = ";"; | |
| var csv = ["time","subject","amount","currency","original_amount","original_currency","category"].join(delim); | |
| $('.node.activity').each(function(){ | |
| csv += "\n" + [ | |
| new Date(parseInt(this.dataset.timestamp)).toISOString(), | |
| $('span h4', this)[0].innerText, | |
| parseInt(this.dataset.amount), | |
| "EUR", | |
| parseInt(this.dataset.originalamount || this.dataset.amount), | |
| this.dataset.originalcurrency || "EUR", | |
| this.dataset.category.substr(6) | |
| ].join(delim); | |
| }); | |
| $('.UIActivityHeader div').first().prepend($('<a/>').attr('target','_blank').attr('href','data:text/csv;base64,'+btoa(csv)).text('Download as CSV')); | |
| //window.open('data:text/csv;' + (window.btoa?'base64,'+btoa(csv):csv)); | |
| })(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Genial, Danke!
Hat ein bisschen gedauert, bis ich den dann erscheinenden Link gesehen hatte, aber funktioniert 1A.