Skip to content

Instantly share code, notes, and snippets.

@matoken
Last active August 4, 2020 21:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matoken/30914e052d33f33ca1c87ca0ddaee4b9 to your computer and use it in GitHub Desktop.
Save matoken/30914e052d33f33ca1c87ca0ddaee4b9 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Steam検索
# https://store.steampowered.com/search/
# ignore_preferences=1 個人設定に基づいたタイトルの除外の無効化
# https://store.steampowered.com/search/?ignore_preferences=1
# Windowsの検索
# https://store.steampowered.com/search/?ignore_preferences=1&os=win
# Mac OS Xの検索
# https://store.steampowered.com/search/?ignore_preferences=1&os=mac
# SteamOS + Linuxの検索
# https://store.steampowered.com/search/?ignore_preferences=1&os=linux
SERCH="https://store.steampowered.com/search/?ignore_preferences=1&os="
OSTYPE=("all" "win" "mac" "linux")
MATCH="results match your search."
declare -A COUNT
for OS in "${OSTYPE[@]}"
do
COUNT[$OS]=$(LC_ALL=en_US.UTF-8 w3m -dump "$SERCH$OS" | grep "$MATCH" | cut -f1 -d' ' | tr -d ,)
echo $OS,${COUNT[$OS]},$(awk "BEGIN { print ${COUNT[$OS]}/${COUNT[all]}*100 }")%
done
@matoken
Copy link
Author

matoken commented Aug 4, 2020

$ bash ./steamcount.bash 
all,79676,100%
win,79806,100.163%
mac,25443,31.9331%
linux,15673,19.6709%
$ date
Wed 05 Aug 2020 06:06:04 AM JST

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment