include whitecube source/rewrite strategies

This commit is contained in:
r888888888
2016-09-23 15:29:49 -07:00
parent 34d1f95cbf
commit 4fa2741ed2
9 changed files with 234 additions and 7 deletions

View File

@@ -6,7 +6,7 @@ class PixivApiClient
class Error < Exception ; end
class WorksResponse
attr_reader :json, :pages, :moniker, :page_count
attr_reader :json, :pages, :name, :moniker, :user_id, :page_count, :tags
attr_reader :artist_commentary_title, :artist_commentary_desc
def initialize(json)
@@ -90,10 +90,13 @@ class PixivApiClient
# }
@json = json
@name = json["user"]["name"]
@user_id = json["user"]["id"]
@moniker = json["user"]["account"]
@page_count = json["page_count"].to_i
@artist_commentary_title = json["title"]
@artist_commentary_desc = json["caption"]
@tags = json["tags"]
if page_count > 1
@pages = json["metadata"]["pages"].map {|x| x["image_urls"]["large"]}