Skip to content

Instantly share code, notes, and snippets.

@taroyanaka
Last active August 2, 2018 12:36
Show Gist options
  • Save taroyanaka/e79eb8b37a0baff69d17c31339ac003b to your computer and use it in GitHub Desktop.
Save taroyanaka/e79eb8b37a0baff69d17c31339ac003b to your computer and use it in GitHub Desktop.
#! /bin/sh
#get ASIN
ASIN=`ruby ./amazon.rb $1|grep "ASIN" -A 1|head -n 2|grep Text|grep -o -E '\".*\"'|tr -d "\""`
#get review text
w3m "https://www.amazon.co.jp/portal/customer-reviews/$ASIN" > /tmp/review.txt
#review rate
cat /tmp/review.txt|grep "のうち.\..$"|uniq|grep -o -E "[0-9]\.[0-9]$"
#review count
cat /tmp/review.txt|grep -E "^[0-9]+$"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment