diff options
author | Squibid <me@zacharyscheiman.com> | 2023-12-27 14:50:22 -0500 |
---|---|---|
committer | Squibid <me@zacharyscheiman.com> | 2023-12-27 14:50:22 -0500 |
commit | ede8620428aa27de24a9a556f5d71ee6a25ac32f (patch) | |
tree | c7239fdb1567aac3c291643600abfc4e2121d6ec /scrapers/wallhaven.php | |
parent | c33a109f4846db21ca06e76826064348b9ee77e8 (diff) | |
parent | 3274ca1700480fe68ad4ec6ea2e43d5aa6edb543 (diff) | |
download | wallheaven-ede8620428aa27de24a9a556f5d71ee6a25ac32f.tar.gz wallheaven-ede8620428aa27de24a9a556f5d71ee6a25ac32f.tar.bz2 wallheaven-ede8620428aa27de24a9a556f5d71ee6a25ac32f.zip |
Diffstat (limited to '')
-rw-r--r-- | scrapers/wallhaven.php | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/scrapers/wallhaven.php b/scrapers/wallhaven.php index 56b44c7..ea03d25 100644 --- a/scrapers/wallhaven.php +++ b/scrapers/wallhaven.php @@ -56,6 +56,21 @@ return array($walls, $meta); } + function gettaginfo($link) { + $decoded = json_decode(callapi("GET", $link), true); + $tag = []; + + foreach($decoded["data"] as $key => $value) { + $tag["id"] = $decoded["data"]["id"]; + $tag["name"] = $decoded["data"]["name"]; + $tag["alias"] = $decoded["data"]["alias"]; + $tag["category_id"] = $decoded["data"]["category_id"]; + $tag["purity"] = $decoded["data"]["purity"]; + $tag["created_at"] = $decoded["data"]["created_at"]; + } + return $tag; + } + function getwallpaper($link) { $decoded = json_decode(callapi("GET", $link), true); $wall = $decoded["data"]; @@ -95,6 +110,9 @@ $wall["tags"][$key]["purity"] = $decoded["data"]["tags"][$key]["purity"]; $wall["tags"][$key]["created_at"] = $decoded["data"]["tags"][$key]["created_at"]; } + $wall["thumbs"]["large"] = $decoded["data"]["thumbs"]["large"]; + $wall["thumbs"]["orig"] = $decoded["data"]["thumbs"]["original"]; + $wall["thumbs"]["small"] = $decoded["data"]["thumbs"]["small"]; } return $wall; } |