Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/claim_review_parsers/reuters.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def score_map
end

def claim_result_from_subhead(page)
header = page.search('div[class^="article-body__content"]').first.search('h2[data-testid="Heading"]').last
header = page.search('div[class^="article-body-module__content"]').first.search('h2[data-testid="Heading"]').last
if header
header.next_sibling.text.split(".").first
end
Expand All @@ -63,7 +63,7 @@ def parse_raw_claim_review(raw_claim_review)
author: raw_claim_review.dig('raw_response', 'authors', 0, 'name'),
author_link: nil,
claim_review_headline: raw_claim_review.dig('raw_response', 'title'),
claim_review_body: raw_claim_review['page'].search('div[class^="article-body__content"]').children.text,
claim_review_body: raw_claim_review['page'].search('div[class^="article-body-module__content"]').children.text,
claim_review_image_url: raw_claim_review.dig('raw_response', 'thumbnail', 'url'),
claim_review_result: claim_result,
claim_review_result_score: score_map[claim_result],
Expand Down
2 changes: 1 addition & 1 deletion spec/fixtures/reuters_brazil_raw.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion spec/fixtures/reuters_raw.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion spec/fixtures/reuters_spanish_raw.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion spec/lib/claim_review_parsers/reuters_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
end

it 'finds claim_result_from_page' do
expect(described_class.new.claim_result_from_page(Nokogiri.parse("<html><div class=\"article-body__content__17Yit\"><h2 data-testid=\"Heading\" class=\"text__text__1FZLe text__dark-grey__3Ml43 text__medium__1kbOh text__heading_6__1qUJ5 heading__base__2T28j heading__heading_6__RtD9P article-body__heading__33EIm\">VEREDICTO</h2><p data-testid=\"paragraph-13\" class=\"text__text__1FZLe text__dark-grey__3Ml43 text__regular__2N1Xr text__small__1kGq2 body__full_width__ekUdw body__small_body__2vQyf article-body__paragraph__2-BtD\">Alterado digitalmente. O post usa um trecho do Jornal Hoje adulterado para forjar a notícia de um falso projeto da Friboi com o governo federal para distribuição de kits churrasco.</p></div></html>"))).to(eq('Alterado digitalmente'))
expect(described_class.new.claim_result_from_page(Nokogiri.parse("<html><div class=\"article-body-module__content__17Yit\"><h2 data-testid=\"Heading\" class=\"text__text__1FZLe text__dark-grey__3Ml43 text__medium__1kbOh text__heading_6__1qUJ5 heading__base__2T28j heading__heading_6__RtD9P article-body__heading__33EIm\">VEREDICTO</h2><p data-testid=\"paragraph-13\" class=\"text__text__1FZLe text__dark-grey__3Ml43 text__regular__2N1Xr text__small__1kGq2 body__full_width__ekUdw body__small_body__2vQyf article-body__paragraph__2-BtD\">Alterado digitalmente. O post usa um trecho do Jornal Hoje adulterado para forjar a notícia de um falso projeto da Friboi com o governo federal para distribuição de kits churrasco.</p></div></html>"))).to(eq('Alterado digitalmente'))
end

it 'parses a raw_claim_review' do
Expand Down
Loading