Skip to content

Commit

Permalink
Fix weasyl for unverified accounts
Browse files Browse the repository at this point in the history
  • Loading branch information
Earlopain committed Oct 2, 2023
1 parent f2ce0df commit a668a0e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app/logical/scraper/weasyl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@ def to_submission(submission)
def fetch_api_identifier
response = fetch_html("https://www.weasyl.com/~#{url_identifier}", headers: { "X-Weasyl-API-Key": Config.weasyl_apikey })
html = Nokogiri::HTML(response.body)
html.at("#user-shouts .comment-form input[name='userid']")&.attribute("value")&.value
shoutbox_id = html.at("#user-shouts .comment-form input[name='userid']")&.attribute("value")&.value
# Unverified accounts can't shout: Your account has to be verified to comment
ignore_id = html.at("form[name=ignoreuser] input[name='userid']")&.attribute("value")&.value
shoutbox_id || ignore_id
end
end
end

0 comments on commit a668a0e

Please sign in to comment.