janoside / btc-rpc-explorer

Database-free, self-hosted Bitcoin explorer, via RPC to Bitcoin Core.
https://bitcoinexplorer.org
MIT License
1.53k stars 1.15k forks source link

dedupe quotes #459

Closed jsarenik closed 2 years ago

jsarenik commented 2 years ago

The poor man's check in shell:

$ grep "\stext:" app/coins/btcQuotes.js \
  | sort | sed 's/  / /' \
  | uniq -c | grep -v "\s1"
      2             text: "I'm sure that in 20 years there will either be very large transaction volume or no volume.",
      2             text: "Lost coins only make everyone else's coins worth slightly more. Think of it as a donation to everyone.",

Explanation: print out all the lines with an empty character followed by "text:" (to not get "context:" for example). Then sort them all. Change double space to one (there is this error in one of our duplicity quotes). Count the unique lines. Filter out the lines which were found only once. The result is the two duplicates before this patch, exactly as reported in #455.

janoside commented 2 years ago

@jsarenik Thanks for helping identify the duplicates. I added a bit of code to include a redirect for the duplicates so the numbering doesn't get shifted for them all. See commit bf6d3093af7.