Skip to content

Instantly share code, notes, and snippets.

@thekarel
Created July 31, 2019 15:05
Show Gist options
  • Save thekarel/4b6a9f06ddf346d87d766815071c6b25 to your computer and use it in GitHub Desktop.
Save thekarel/4b6a9f06ddf346d87d766815071c6b25 to your computer and use it in GitHub Desktop.
Bookmarklet: Copy nutrition information from Ocado
javascript:var vals = window.getSelection().toString().split('\n').map(row => {const cells = row.split('\t'); return cells[1]}).map(val => val.replace(/(g|kcal)$/, '')).join('\t');navigator.clipboard.readText(vals).then(() => alert(vals)).catch(err => alert(err))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment