publiclab / webjack

a JavaScript library that uses an audio software modem to communicate with an Arduino via a headphone jack
https://webjack.io
GNU General Public License v3.0
135 stars 26 forks source link

enable downloading log as a CSV #103

Open jywarren opened 5 years ago

jywarren commented 5 years ago

It'd be great to be able to download the log as a CSV! Of course, you can just copy and paste it into a file right now. But still, a one-click button would be nice!

jywarren commented 5 years ago
var csv = connection.history.received.join('\n'); // the CSV data

// old school, but doesn't seem to work for me?

window.open("data:text/csv;charset=utf-8," + escape(csv));

or generate a link: https://stackoverflow.com/questions/17564103/using-javascript-to-download-file-as-a-csv-file

<a href="data:text/csv;charset=utf-8,'+escape(csv)+'" download="webjack.csv">download</a>

We should put the timestamp (and ideally the better-formatted date + time) in the filename; new Date().toJSON().slice(0,10).replace(/-/g,'/'); gets the date, and we can add timestamp after that maybe...

jywarren commented 5 years ago

Let's put the button here! https://github.com/publiclab/webjack/blob/ce5d2a943bd18e55911a7ecbef7702570e533164/examples/index.html#L55-L58

DevanshCodes commented 4 years ago

Hey, if its still open, can I claim it?

jywarren commented 4 years ago

Yes please! Thanks for the help!

On Sun, Dec 29, 2019, 3:02 AM Devansh Agarwal notifications@github.com wrote:

Hey, if its still open, can I claim it?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/publiclab/webjack/issues/103?email_source=notifications&email_token=AAAF6J5K6W6TEBUOHAKRSSTQ3BKQPA5CNFSM4HH5PGP2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEHY2FIQ#issuecomment-569483938, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAF6JZVUW2Q7U463OQLRCTQ3BKQPANCNFSM4HH5PGPQ .

sifihog commented 4 years ago

Hello! Just wondering if there's been any progress on this? I'd like to submit a pull request if its still open.