Open main menu

User:TweetsFactsAndQueries/URL encoding

< User:TweetsFactsAndQueries

Since Developer Edition 53, Firefox no longer URL-encodes the URL you copy from query.wikidata.org, so the link breaks off early when pasting it into Twitter. Here’s the quick’n’dirty one-liner I use to fix that, just in case I ever lose it (limited Bash history):

xclip -o | sed 's { %7B g; s } %7D g; s ( %28 g; s ) %29 g; s \^ %5E g; s/ /%20/g; s " %22 g; s … %E2%80%A8 g; s < %3C g; s < %3C g; s > %3E g; s “ %E2%80%9C g; s ” %E2%80%9D g; s \\ %5C g; s ’ %E2%80%99 g; s \[ %5B g; s \] %5D g;' | xclip