Created
October 19, 2017 18:33
-
-
Save adamburmister/f224ab1dacc8767f8983234a9fc1157b to your computer and use it in GitHub Desktop.
CLI to look up Porsche vehicle details (sale price, options lists, warranty info) from a VIN
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/sh | |
if [ "$#" -ne 1 ]; then | |
echo "Usage: $0 VIN" >&2 | |
exit 1 | |
fi | |
# Usage: | |
output_file_name="/tmp/porsche-$1.html" | |
curl -s -# http://admin.porschedealer.com/reports/build_sheets/print.php\?vin\=$1 | pup "style, .container" > $output_file_name | |
if type "open" > /dev/null; then | |
open $output_file_name | |
fi | |
echo "Wrote $output_file_name" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment