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
#!/bin/bash | |
# Takes a mapping csv with the first column containing the values to replace-with and the 2nd to nth columns containing the patterns | |
# to replace-by. The target document is matched by cell against each pattern, and a cell that matches is replaced in the output (mfr_output.csv) | |
# by the replace value corresponding to the first pattern it matches on. | |
# Known issues: | |
# Seems to be bad at matching certain accented chars, encoding issues? Maybe deburr before matching if you have that problem | |
mapping_file=$1 |
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
// Don't go pasting scripts from internet strangers in your dev consoles, ok? | |
/* | |
Procudeure (for my own sake, because YOU wouldn't go and paste scripts from a stranger in to your dev console, right?): | |
1) visit https://bandcamp.com/<username>/purchases | |
2) run the code under the SETTING UP THE PAGE heading in the dev tool's console | |
3) run the code under the ACTUALLY SCRAPING heading in the dev tool's console | |
optional: change "CAD" argument on final line to alternate desired currency code | |
4) raise your eyebrows at the output (and keep in mind that you're applying current | |
conversion rates retroactively, and thus getting a skewed result) |