pawoo: fetch tags and commentary.

This commit is contained in:
evazion
2017-06-10 23:58:27 -05:00
parent 1bfc0a7d8a
commit 6edb5a807b
2 changed files with 14 additions and 0 deletions

View File

@@ -47,6 +47,17 @@ class PawooApiClient
def image_urls
json["media_attachments"].map {|x| x["url"]}
end
def tags
json["tags"].map { |tag| [tag["name"], tag["url"]] }
end
def commentary
commentary = ""
commentary << "<p>#{json["spoiler_text"]}</p>" if json["spoiler_text"].present?
commentary << json["content"]
commentary
end
end
def get_status(url)

View File

@@ -33,6 +33,9 @@ module Sources::Strategies
@profile_url = response.account_profile_url
@image_url = response.image_urls.first
@image_urls = response.image_urls
@tags = response.tags
@artist_commentary_title = nil
@artist_commentary_desc = response.commentary
end
def normalized_url