Merge pull request #3118 from evazion/fix-nicoseiga-artcomm
Fix #3117: Nicoseiga handler grabbing wrong commentary source
This commit is contained in:
@@ -28,15 +28,16 @@ class NicoSeigaApiClient
|
|||||||
end
|
end
|
||||||
|
|
||||||
def parse_artist_xml_response(text)
|
def parse_artist_xml_response(text)
|
||||||
doc = Nokogiri::Slop(text)
|
doc = Hash.from_xml(text)
|
||||||
@moniker = doc.response.user.nickname.content
|
@moniker = doc["response"]["user"]["nickname"]
|
||||||
end
|
end
|
||||||
|
|
||||||
def parse_illust_xml_response(text)
|
def parse_illust_xml_response(text)
|
||||||
doc = Nokogiri::Slop(text)
|
doc = Hash.from_xml(text)
|
||||||
@image_id = doc.response.image.id.content.to_i
|
image = doc["response"]["image"]
|
||||||
@user_id = doc.response.image.user_id.content.to_i
|
@image_id = image["id"].to_i
|
||||||
@title = doc.response.image.title.content
|
@user_id = image["user_id"].to_i
|
||||||
@desc = [doc.response.image.description.try(:content), doc.response.image.summary.try(:content)].compact.join("\n\n")
|
@title = image["title"]
|
||||||
|
@desc = image["description"]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ module Sources
|
|||||||
|
|
||||||
should "get the artist commentary" do
|
should "get the artist commentary" do
|
||||||
assert_equal("コジコジ", @site_2.artist_commentary_title)
|
assert_equal("コジコジ", @site_2.artist_commentary_title)
|
||||||
assert_equal("懐かしいですよね。テ また懐かしいものを ", @site_2.artist_commentary_desc)
|
assert_equal("コジコジのドット絵\nこんなかわいらしい容姿で毒を吐くコジコジが堪らん(切実)", @site_2.artist_commentary_desc)
|
||||||
end
|
end
|
||||||
|
|
||||||
should "get the image url" do
|
should "get the image url" do
|
||||||
|
|||||||
Reference in New Issue
Block a user