---
url: 'http://workflows-of-ai.com/blog/compare-news-sources'
title: 'Compare News Sources'
author:
  name: 'Marcus Johansson'
  url: 'http://workflows-of-ai.com/about/marcus-johansson'
date: '2023-10-13T22:31:42+02:00'
updated: '2026-10-10T12:14:04+02:00'
type: article
summary: 'Scrape a CNN and a Fox News article with the AI Interpolator ScrapingBot rule and have OpenAI compare their tone and sentiment in Drupal.'
tags:
  - 'Marcus Johansson'
  - Workflows
  - 'Drupal AI'
image: 'http://workflows-of-ai.com/sites/default/files/previews/6ad8e1ea11d86bd9.jpg'
published: true
og:
  site_name: 'Workflows of AI'
  'image:width': '1280'
  'image:height': '720'
  'image:alt': 'Compare News Sources'
---
Drupal AI

# Compare News Sources

Scrape two news articles on the same topic and let AI compare their tone and sentiment side by side.

  Marcus Johansson

October 13, 2023 · 2 min read

 ## About this video

In this workflow, we begin by utilizing the AI Interpolator ScrapingBot module to extract content from CNN and FOX News. I'm looking to obtain articles related to Generative AI from both sources. The ScrapingBot module is straightforward in its application; it's tasked with retrieving the full articles, ensuring all relevant content is captured for analysis.

Once the articles are scraped, they’re fed into the AI Interpolator OpenAI module. The OpenAI algorithms, renowned for their accuracy, evaluate the content to determine the sentiment and tone. Each article is assessed independently, focusing on the inherent nuances and linguistic elements that reveal the underlying sentiments and perspectives presented in the articles.

The outcome is a clear analysis that delineates the differences in sentiment and tone between the two articles. It offers a glimpse into how each media outlet approaches the topic of Generative AI, without added complexity. This isn’t about flashy presentations or intricate displays, but a clear, concise and factual representation of the sentiments and tones embodied in the respective articles. This workflow simplifies the process of comparing content from different sources, making the task manageable and efficient.

*This video is from before the AI Interpolator module became AI Automators, part of the [AI module](https://www.drupal.org/project/ai). Module and menu names have changed since, and some steps look different today.*

## Watch the video

[Watch on YouTube: Compare News Sources](https://www.youtube.com/watch?v=YtZpk_8osMo)

### Video chapters

- 0:00 CNN versus Fox News on AI
- 1:10 Content type and link fields
- 2:00 Scraping with ScrapingBot
- 2:47 The diff sentiment prompt
- 4:40 Running the comparison
- 5:36 Reading the analysis

## Transcript

YouTube's automatic captions, lightly corrected. Click a line to jump to that moment in the video.

### Transcript

- 0:02 hey there Marcus here um the workflow today I'm not actually going to show you how to set it up it's already set up so it's a little bit like the chefs on TV where everything is
- 0:13 prepared uh but I will show you what is set up and what is going to do so the workflow today is we're going to take two different uh articles talking about Labor Market in AI one from Fox News and
- 0:25 one from CNN we're going to scrape those uh and then we're going to analyze what's the difference between them how how how do they uh which tone do they have which sentiment do they
- 0:40 have uh as always this is Drupal uh vanilla Drupal installed already uh AI interpolator installed already and in this case I have set up the content types and Fields that we need but I'm
- 0:52 going to go through that now uh also as always this is open source it's completely free you can set it up directly after this video is done all by yourself on your computer or in a uh
- 1:04 server in the cloud so we start by logging in then I'm going to show you the content type here then so I called it diff In Articles uh we're using content types in
- 1:17 this case but usually when you work with a lot of data and um data analytics you should be doing custom entities in Drupal right um and in this case you could even run it as API and have the
- 1:32 data stored outside of Drupal if you would like if you're uh doing a lot of data analyses right so first of all they have two uh link Fields here and the link Fields
- 1:45 it's just a CNN link and a Fox News links that's taking external links no link text needed they are required both of them then we have the Fox News article that's a text format long
- 1:57 because that's a HTML field right uh and these using the ScrapingBot crawler then that's the crawler using the ScrapingBot API services so the Fox News article is
- 2:09 getting its uh Bas it's based on the Fox News link right so it's going to go to this link scrape it and then under advanced settings we have made sure that we're using browsers because we're using
- 2:20 the ScrapingBot services and we're from United States so there's no uh GDPR blocker or something like that and then the crawler mode is set to article segment because we just want the content
- 2:31 we don't want the whole website because we only care about the actual content and we don't want some specific selector that you can also do with this we have made sure that it's in batch mode so we
- 2:43 can see the progress we did the same with the CNN article then and then the last thing is a diff sentiment where we want to see the difference between these and here is the
- 2:54 interesting thing then because since we have two context fields in this case we can use a base field so we having the rule open a string long that takes text and generates text right but we have
- 3:07 something called the advanc mode which is based on a token module and the token module gives you all the tokens available for this entity which means that we have all the
- 3:18 fields under the the node in this case so you can see here based on article one and article this is the prompt based on article one and article two look at how they differ in tone sentiment and
- 3:28 analysis on the sub object into sentences write me eight sentences on this we have article one the limiter and then the token for that article to delimiter the article for
- 3:41 that then under advanced settings we make sure that the interpolator weight is higher because of course we have to make sure that the content of uh the website is scraped before we do the analysis
- 3:55 runs batch mode GPT-4 because this is pretty uh complex so now we can just try to do this and since it's identity type we could sorry we could set up we could do this with as many links as we want
- 4:10 right this it's not just this CNN link and this Fox News links this is just example here right I also make sure to show the field so you can see that they're actually going to be filled out
- 4:21 if you're going to sell this as a service or something you should of course hide that data also since it's scraping you have to check check your local law you might not be able uh be
- 4:33 allowed to store it right this is just for an example now so we do comparison going to get the CNN link paste it in we're going to get the fox link and paste it in this we don't have
- 4:48 to fill in because that's going to get filled in same with the diff sentiment hopefully now then click save and the AI interpolator starts working it's going to be three uh jobs that it need needs
- 4:59 to do in the progress part so it's currently scraping one of the websites now it started scraping the second website and then as third thing hopefully now it's going to do uh
- 5:13 basically a diff analysis on how they um how they uh look at the topic from which angles which tone which sentiment and so on it wasn't a very um Advanced prompt right now so this comes
- 5:30 back to prompt engineering you can of course create a lot more advanced prompts here to get exactly what you're looking for so I go to edit again so we can see it in field mode so you see it's
- 5:41 got the CNN article and just the content right same with Fox News just the content and then it has the diff sentiment here so both articles discuss the potential impact of artificial
- 5:54 intelligence on labor markets specifically addressing blah blah blah however they differ in tone Center ment and Analysis article one from CNN adopts a more neutral tone and provides an
- 6:04 in-depth analysis on report by Goldman Sachs and I um this uh I just took two articles now and I think actually the Fox News article was more of a of a a opinion piece so this doesn't say
- 6:21 anything about the actual uh news sources uh it was just to have some example in this case so so that is basically how you would set up such an analysis uh using the AI
- 6:36 interpolator so um yeah have fun doing it thank you for watching

  Filed under [Workflows](/blog?category=6) [Drupal AI](/blog?category=2)

Parts of this content were produced by AI.

This site has not assessed whether a label is required for this content.

  How was AI used?The video and the introduction are Marcus's own, first published on workflows-of-ai.com. AI wrote the subtitle, the summary and the video chapters from the transcript, and corrected misheard names in YouTube's automatic captions.

   Marcus Johansson

Tinkers with AI and Drupal

 [About Marcus](/about/marcus-johansson)[Drupal.org profile](https://www.drupal.org/u/marcus_johansson)[Drupal AI](https://www.drupal.org/project/ai)

## The post in three sentences

A content type takes two links, one to CNN and one to Fox News, both about AI and the labor market. ScrapingBot fields scrape each article's main content, and an OpenAI rule in advanced mode uses tokens to compare both texts in eight sentences on tone and sentiment. The workflow is already set up, so the video walks through the fields and runs it once.