Skip to content

Instantly share code, notes, and snippets.

@pachacamac
Last active April 1, 2016 11:36
Show Gist options
  • Select an option

  • Save pachacamac/ce4ce71498152bf11b60a17b79152418 to your computer and use it in GitHub Desktop.

Select an option

Save pachacamac/ce4ce71498152bf11b60a17b79152418 to your computer and use it in GitHub Desktop.
Number26 CSV Download Bookmarklet
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));
})();
@wuhup
Copy link

wuhup commented Apr 1, 2016

Genial, Danke!

Hat ein bisschen gedauert, bis ich den dann erscheinenden Link gesehen hatte, aber funktioniert 1A.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment