Skip to content

Commit 526c396

Browse files
committed
Fix for parsing questions, from wolfy
THis is taken from wolfymaster@4b0e1c5 However it appears to not work correctly, in the question, there is still a part of the answer. This is the question as served by jService: [ { "id": 1169, "answer": "Barbie", "question": "Collectors of this ever-fashionable doll know that she's celebrating the 45th anniversary of her debutBarbieJerry", "value": 200, "airdate": "2004-05-31T10:00:00.000Z", "created_at": "2023-12-15T23:00:48.104Z", "updated_at": "2023-12-15T23:00:48.104Z", "category_id": 241, "game_id": 2645, "invalid_count": null, "category": { "id": 241, "title": "hobbies", "created_at": "2023-12-15T23:00:48.004Z", "updated_at": "2023-12-15T23:00:48.004Z", "clues_count": 2 } } ]
1 parent b7d0a2c commit 526c396

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

lib/tasks/get_latest.rake

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,13 @@
6161

6262
if(!qdiv.nil?)
6363
qdivMouseover = qdiv.attr('onmouseover')
64-
#=========== Set Answer =============
65-
answermatch = /ponse">(.*)<\/e/.match(qdivMouseover)
64+
id = qdivMouseover.split(',')[1].strip.delete("'")
65+
66+
answerDiv = game.css("#".concat(id))
67+
68+
#=========== Set Answer =============
69+
answermatch = /ponse">(.*)<\/e/.match(answerDiv.to_html)
70+
6671
var_answer = answermatch.captures[0].to_s
6772

6873
#puts var_answer

0 commit comments

Comments
 (0)