Adapt to Reddit json API structure change (closes #3)

This commit is contained in:
Gabriel Ostrolucký 2019-01-05 14:20:21 +01:00
parent 2261cef1fe
commit 7f374d5332
1 changed files with 2 additions and 2 deletions

View File

@ -5,7 +5,7 @@ output="down"
useragent="Love by u/gadelat" useragent="Love by u/gadelat"
subreddit=$1 subreddit=$1
url="https://www.reddit.com/r/$subreddit/.json" url="https://www.reddit.com/r/$subreddit/.json?raw_json=1"
content=`wget -U "$useragent" -q -O - $url` content=`wget -U "$useragent" -q -O - $url`
mkdir -p $output mkdir -p $output
while : ; do while : ; do
@ -27,7 +27,7 @@ while : ; do
if [ -z $after ]; then if [ -z $after ]; then
break break
fi fi
url="https://www.reddit.com/r/$subreddit/.json?count=200&after=$after" url="https://www.reddit.com/r/$subreddit/.json?count=200&after=$after&raw_json=1"
content=`wget -U "$useragent" --no-check-certificate -q -O - $url` content=`wget -U "$useragent" --no-check-certificate -q -O - $url`
#echo -e "$urls" #echo -e "$urls"
done done