summaryrefslogtreecommitdiff
path: root/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'index.js')
-rw-r--r--index.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/index.js b/index.js
index caf5125..1da60a5 100644
--- a/index.js
+++ b/index.js
@@ -155,6 +155,10 @@ function chooseWaifu() {
fetch("https://api.waifu.im/search").then((response) => {
response.json().then((json) => {
doc.getElementById("waifu").src = json["images"][0]["url"];
+ doc.getElementById("waifu-link").href =
+ json["images"][0]["source"] ||
+ json["images"][0]["artist"]["twitter"] ||
+ json["images"][0]["artist"]["pixiv"];
});
});
}