Fixed weeb search, default anime
This commit is contained in:
parent
81d24e4c49
commit
cbc72c9f21
1
outputdata.json
Normal file
1
outputdata.json
Normal file
File diff suppressed because one or more lines are too long
14
styli.sh
14
styli.sh
@ -1,10 +1,14 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
link="https://source.unsplash.com/random/"
|
link="https://source.unsplash.com/random/"
|
||||||
|
|
||||||
|
# https://www.reddit.com/r/Animewallpaper/search/.json?q=flair_name%3ADesktop&restrict_sr=1
|
||||||
|
|
||||||
reddit(){
|
reddit(){
|
||||||
useragent="thevinter"
|
useragent="thevinter"
|
||||||
timeout=60
|
timeout=60
|
||||||
|
|
||||||
readarray subreddits < subreddits
|
readarray subreddits < subreddits
|
||||||
|
|
||||||
a=${#subreddits[@]}
|
a=${#subreddits[@]}
|
||||||
b=$(($RANDOM % $a))
|
b=$(($RANDOM % $a))
|
||||||
sub=${subreddits[$b]}
|
sub=${subreddits[$b]}
|
||||||
@ -21,9 +25,15 @@ reddit(){
|
|||||||
if [ ! -z $1 ]; then
|
if [ ! -z $1 ]; then
|
||||||
sub=$1
|
sub=$1
|
||||||
fi
|
fi
|
||||||
url="https://www.reddit.com/r/$sub/$sort/.json?raw_json=1&t=$top_time"
|
# url="https://www.reddit.com/r/$sub/$sort/.json?raw_json=1&t=$top_time"
|
||||||
|
url="https://www.reddit.com/r/$sub/search/.json?q=flair_name%3ADesktop&restrict_sr=1"
|
||||||
|
# echo $url
|
||||||
|
# exit
|
||||||
content=`wget -T $timeout -U "$useragent" -q -O - $url`
|
content=`wget -T $timeout -U "$useragent" -q -O - $url`
|
||||||
urls=$(echo -n "$content"| jq -r '.data.children[]|select(.data.post_hint|test("image")?) | .data.preview.images[0].source.url')
|
# echo $content
|
||||||
|
# exit
|
||||||
|
# urls=$(echo -n "$content"| jq -r '.data.children[]|select(.data.post_hint|test("image")?) | .data.preview.images[0].source.url')
|
||||||
|
urls=$(echo -n "$content"| jq -r '.data.children[]|select(.data.post_hint|test("image")?) | .data.url')
|
||||||
names=$(echo -n "$content"| jq -r '.data.children[]|select(.data.post_hint|test("image")?) | .data.title')
|
names=$(echo -n "$content"| jq -r '.data.children[]|select(.data.post_hint|test("image")?) | .data.title')
|
||||||
ids=$(echo -n "$content"| jq -r '.data.children[]|select(.data.post_hint|test("image")?) | .data.id')
|
ids=$(echo -n "$content"| jq -r '.data.children[]|select(.data.post_hint|test("image")?) | .data.id')
|
||||||
arrURLS=($urls)
|
arrURLS=($urls)
|
||||||
|
|||||||
@ -1,5 +1 @@
|
|||||||
wallpapers
|
Animewallpaper
|
||||||
earthporn
|
|
||||||
spaceporn
|
|
||||||
wallpaper
|
|
||||||
pic
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user