Skip to content

Instantly share code, notes, and snippets.

@0xallie
Last active September 1, 2018 21:25
Show Gist options
  • Save 0xallie/82515c9df349a1639d35fc1ced74a429 to your computer and use it in GitHub Desktop.
Save 0xallie/82515c9df349a1639d35fc1ced74a429 to your computer and use it in GitHub Desktop.
#!/bin/bash
#
# Példa: ./musortv.sh cimek.txt CARTOON 2018 05 01 08 31
cimek=$(<"$1" tr '\n' '|' | sed -r 's/\|$//')
csat=$2
ev=$3
kho=$4
knap=$5
vho=$6
vnap=$7
for ho in $(seq "$kho" "$vho"); do
for nap in $(seq "$knap" "$vnap"); do
datum=$(printf '%d.%02d.%02d' "$ev" "$ho" "$nap")
printf '\r%s:' "$datum"
talalat=$(curl -s "https://musor.tv/napi/tvmusor/$csat/$datum" | grep -Eio "$cimek" | sort -u)
if [[ -n "$talalat" ]]; then
printf '\n%s\n\n' "$talalat"
fi
done
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment