Adding tags to inkbunny

This commit is contained in:
Chaska 2024-04-29 01:01:52 -05:00
parent 9af9334213
commit b947079616
2 changed files with 6 additions and 1 deletions

View file

@ -13,6 +13,7 @@ defmodule Philomena.Scrapers.Inkbunny do
json = Jason.decode!(body) json = Jason.decode!(body)
[submission] = json["submissions"] [submission] = json["submissions"]
tags = submission["keywords"]["keyword_name"]
images = for x <- submission["files"] do images = for x <- submission["files"] do
%{ %{
@ -23,6 +24,7 @@ defmodule Philomena.Scrapers.Inkbunny do
%{ %{
source_url: url, source_url: url,
tags: tags,
author_name: submission["username"], author_name: submission["username"],
description: submission["description"], description: submission["description"],
images: images images: images

View file

@ -315,7 +315,7 @@ defmodule PhilomenaWeb.ImageView do
"pbs.twimg.com", "pbs.twimg.com",
"twimg.com" "twimg.com"
] -> ] ->
"fab fa-twitter" "fa-brands fa-twitter"
u u
when u in [ when u in [
@ -451,6 +451,9 @@ defmodule PhilomenaWeb.ImageView do
u when u in ["etsy.com", "www.etsy.com"] -> u when u in ["etsy.com", "www.etsy.com"] ->
"fab fa-etsy" "fab fa-etsy"
u when u in ["derpibooru.org", "derpicdn.net"] ->
"fa-solid fa-horse-head"
link -> link ->
cond do cond do
Enum.member?(site_domains, link) -> Enum.member?(site_domains, link) ->