-
-
Save confluencepoint/12ac78b134bbdadb8b00a94ec1bfe531 to your computer and use it in GitHub Desktop.
Extract canonical URL from Apple News URL
This file contains hidden or 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 | |
# Usage: | |
# | |
# 1. Create a `apple-news` file somewhere in your $PATH with the content of this file | |
# 2. That’s it! You can now use the `apple-news` utility: | |
# | |
# ``` | |
# $ apple-news https://apple.news/AKoDCWtVEQP2w7Ld657lgIg | |
# https://www.theguardian.com/technology/2022/mar/30/dyson-launches-zone-air-purifying-bluetooth-headphones-with-visor | |
# ``` | |
curl -s -XGET $1 | grep "redirectToUrl(\"" | sed -e "s/^ *redirectToUrl(\"//" | sed -e "s/\");$//" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment