The chart shows coverage by Bloomberg, CNBC, CNN, CSPAN, CSPAN2, CSPAN3, FBC, Fox News, and MSNBC of selected topics, in weekly counts of 15-second programming segments.

In the figure’s legend, click once on a topic to remove it from the chart. Click again to restore it to the chart. Double click on a topic to remove all other topics from the chart.

Segment counts, by topic and week

The next three charts show the topic volumes for Fox News, CNN, and MSNBC, separately. Again, in the figure’s legend, click once on a topic to remove it from the chart. Click again to restore it to the chart. Double click on a topic to remove all other topics from the chart.

Segment counts, by topic and week, Fox News

Segment counts, by topic and week, CNN

Segment counts, by topic and week, MSNBC

R Code:

if (!require("tidyverse")) 
  install.packages("tidyverse")
if (!require("plotly"))
  install.packages("plotly")
library(tidyverse)
library(plotly)

# Defining date range

startdate <- "20220214"
enddate <- "20241009"

# Defining query

query <- "(russia%20OR%20ukrain)"

# Building the volume dataframe

vp1 <- "https://api.gdeltproject.org/api/v2/tv/tv?query="
vp2 <- "%20market:%22National%22&mode=timelinevol&format=csv&datanorm=raw&startdatetime="
vp3 <- "000000&enddatetime="
vp4 <- "000000"
text_v_url <- paste0(vp1, query, vp2, startdate, vp3, enddate, vp4)
v_url <- URLencode(text_v_url)
v_url
Ukraine <- read_csv(v_url)
Ukraine <- Ukraine %>% 
  rename(Date = 1, Ukraine = 3)

### Gaza

# Defining query

query <- "(gaza%20OR%20israel)"

# Building the volume dataframe

vp1 <- "https://api.gdeltproject.org/api/v2/tv/tv?query="
vp2 <- "%20market:%22National%22&mode=timelinevol&format=csv&datanorm=raw&startdatetime="
vp3 <- "000000&enddatetime="
vp4 <- "000000"
text_v_url <- paste0(vp1, query, vp2, startdate, vp3, enddate, vp4)
v_url <- URLencode(text_v_url)
v_url
Gaza <- read_csv(v_url)
Gaza <- Gaza %>% 
  rename(Date = 1, Gaza = 3)

AllData <- left_join(Ukraine, Gaza)

### Trump

# Defining query

query <- "donald%20trump"

# Building the volume dataframe

vp1 <- "https://api.gdeltproject.org/api/v2/tv/tv?query="
vp2 <- "%20market:%22National%22&mode=timelinevol&format=csv&datanorm=raw&startdatetime="
vp3 <- "000000&enddatetime="
vp4 <- "000000"
text_v_url <- paste0(vp1, query, vp2, startdate, vp3, enddate, vp4)
v_url <- URLencode(text_v_url)
v_url
Trump <- read_csv(v_url)
Trump <- Trump %>% 
  rename(Date = 1, Trump = 3)

AllData <- left_join(AllData, Trump)

### Harris

# Defining query

query <- "Kamala%20Harris"

# Building the volume dataframe

vp1 <- "https://api.gdeltproject.org/api/v2/tv/tv?query="
vp2 <- "%20market:%22National%22&mode=timelinevol&format=csv&datanorm=raw&startdatetime="
vp3 <- "000000&enddatetime="
vp4 <- "000000"
text_v_url <- paste0(vp1, query, vp2, startdate, vp3, enddate, vp4)
v_url <- URLencode(text_v_url)
v_url
Harris <- read_csv(v_url)
Harris <- Harris %>% 
  rename(Date = 1, Harris = 3)

AllData <- left_join(AllData, Harris)

### Biden

# Defining query

query <- "Joe%20Biden"

# Building the volume dataframe

vp1 <- "https://api.gdeltproject.org/api/v2/tv/tv?query="
vp2 <- "%20market:%22National%22&mode=timelinevol&format=csv&datanorm=raw&startdatetime="
vp3 <- "000000&enddatetime="
vp4 <- "000000"
text_v_url <- paste0(vp1, query, vp2, startdate, vp3, enddate, vp4)
v_url <- URLencode(text_v_url)
v_url
Biden <- read_csv(v_url)
Biden <- Biden %>% 
  rename(Date = 1, Biden = 3)

AllData <- left_join(AllData, Biden)

### abortion

# Defining query

query <- "abortion"

# Building the volume dataframe

vp1 <- "https://api.gdeltproject.org/api/v2/tv/tv?query="
vp2 <- "%20market:%22National%22&mode=timelinevol&format=csv&datanorm=raw&startdatetime="
vp3 <- "000000&enddatetime="
vp4 <- "000000"
text_v_url <- paste0(vp1, query, vp2, startdate, vp3, enddate, vp4)
v_url <- URLencode(text_v_url)
v_url
abortion <- read_csv(v_url)
abortion <- abortion %>% 
  rename(Date = 1, Abortion = 3)

AllData <- left_join(AllData, abortion)

### election

# Defining query

query <- "election"

# Building the volume dataframe

vp1 <- "https://api.gdeltproject.org/api/v2/tv/tv?query="
vp2 <- "%20market:%22National%22&mode=timelinevol&format=csv&datanorm=raw&startdatetime="
vp3 <- "000000&enddatetime="
vp4 <- "000000"
text_v_url <- paste0(vp1, query, vp2, startdate, vp3, enddate, vp4)
v_url <- URLencode(text_v_url)
v_url
election <- read_csv(v_url)
election <- election %>% 
  rename(Date = 1, Election = 3)

AllData <- left_join(AllData, election)

### Graphic

AllData <- AllData %>% 
  arrange(Date) 

# Add "WeekOf" variable to the data frame

if (!require("lubridate")) install.packages("lubridate")
library(lubridate)

AllData$WeekOf <- round_date(AllData$Date,
                               unit = "week",
                               week_start = getOption("lubridate.week.start",1))


CombinedCoverage <- AllData %>% 
  group_by(WeekOf) %>% 
  summarize(
    Ukraine = sum(Ukraine, na.rm = TRUE),
    Gaza = sum(Gaza, na.rm = TRUE),
    Trump = sum(Trump, na.rm = TRUE),
    Biden = sum(Biden, na.rm = TRUE),
    Harris = sum(Harris, na.rm = TRUE),
    Abortion = sum(Abortion, na.rm = TRUE),
    Election = sum(Election, na.rm = TRUE))


fig <- plot_ly(CombinedCoverage, x = ~WeekOf, y = ~Ukraine, 
               name = 'Ukraine', type = 'scatter', 
               mode = 'none', stackgroup = 'one', 
               fillcolor = '#264653')
fig <- fig %>% add_trace(y = ~Gaza, 
                         name = 'Gaza', 
                         fillcolor = '#287271')
fig <- fig %>% add_trace(y = ~Trump, name = 'Trump', 
                         fillcolor = '#2a9d8f')
fig <- fig %>% add_trace(y = ~Biden, name = 'Biden',
                         fillcolor = '#8ab17d')
fig <- fig %>% add_trace(y = ~Harris, name = 'Harris', 
                         fillcolor = '#e9c46a')
fig <- fig %>% add_trace(y = ~Abortion, name = 'Abortion', 
                         fillcolor = '#f4a261')
fig <- fig %>% add_trace(y = ~Election, name = 'Election', 
                         fillcolor = '#e76f51')
fig <- fig %>% layout(title = 'Segment counts, by topic and week',
                      xaxis = list(title = "Week of",
                                   showgrid = FALSE),
                      yaxis = list(title = "Count",
                                   showgrid = TRUE))

fig

### Results for Fox News, CNN, and MSNBC, separately

#Fox News

FoxNews <- AllData %>% 
  filter(Series == "FOXNEWS")
figFox <- plot_ly(FoxNews, x = ~WeekOf, y = ~Ukraine, 
               name = 'Ukraine', type = 'scatter', 
               mode = 'none', stackgroup = 'one', 
               fillcolor = '#264653')
figFox <- figFox %>% add_trace(y = ~Gaza, 
                         name = 'Gaza', 
                         fillcolor = '#287271')
figFox <- figFox %>% add_trace(y = ~Trump, name = 'Trump', 
                         fillcolor = '#2a9d8f')
figFox <- figFox %>% add_trace(y = ~Biden, name = 'Biden',
                         fillcolor = '#8ab17d')
figFox <- figFox %>% add_trace(y = ~Harris, name = 'Harris', 
                         fillcolor = '#e9c46a')
figFox <- figFox %>% add_trace(y = ~Abortion, name = 'Abortion', 
                         fillcolor = '#f4a261')
figFox <- figFox %>% add_trace(y = ~Election, name = 'Election', 
                         fillcolor = '#e76f51')
figFox <- figFox %>% layout(title = 'Segment counts, Fox News, by topic and week',
                      xaxis = list(title = "Week of",
                                   showgrid = FALSE),
                      yaxis = list(title = "Count",
                                   showgrid = TRUE))
figFox

# CNN

CNN <- AllData %>% 
  filter(Series == "CNN")
figCNN <- plot_ly(CNN, x = ~WeekOf, y = ~Ukraine, 
                  name = 'Ukraine', type = 'scatter', 
                  mode = 'none', stackgroup = 'one', 
                  fillcolor = '#264653')
figCNN <- figCNN %>% add_trace(y = ~Gaza, 
                               name = 'Gaza', 
                               fillcolor = '#287271')
figCNN <- figCNN %>% add_trace(y = ~Trump, name = 'Trump', 
                               fillcolor = '#2a9d8f')
figCNN <- figCNN %>% add_trace(y = ~Biden, name = 'Biden',
                               fillcolor = '#8ab17d')
figCNN <- figCNN %>% add_trace(y = ~Harris, name = 'Harris', 
                               fillcolor = '#e9c46a')
figCNN <- figCNN %>% add_trace(y = ~Abortion, name = 'Abortion', 
                               fillcolor = '#f4a261')
figCNN <- figCNN %>% add_trace(y = ~Election, name = 'Election', 
                               fillcolor = '#e76f51')
figCNN <- figCNN %>% layout(title = 'Segment counts, CNN, by topic and week',
                            xaxis = list(title = "Week of",
                                         showgrid = FALSE),
                            yaxis = list(title = "Count",
                                         showgrid = TRUE))
figCNN

# MSNBC

MSNBC <- AllData %>% 
  filter(Series == "MSNBC")
figMSNBC <- plot_ly(MSNBC, x = ~WeekOf, y = ~Ukraine, 
                  name = 'Ukraine', type = 'scatter', 
                  mode = 'none', stackgroup = 'one', 
                  fillcolor = '#264653')
figMSNBC <- figMSNBC %>% add_trace(y = ~Gaza, 
                               name = 'Gaza', 
                               fillcolor = '#287271')
figMSNBC <- figMSNBC %>% add_trace(y = ~Trump, name = 'Trump', 
                               fillcolor = '#2a9d8f')
figMSNBC <- figMSNBC %>% add_trace(y = ~Biden, name = 'Biden',
                               fillcolor = '#8ab17d')
figMSNBC <- figMSNBC %>% add_trace(y = ~Harris, name = 'Harris', 
                               fillcolor = '#e9c46a')
figMSNBC <- figMSNBC %>% add_trace(y = ~Abortion, name = 'Abortion', 
                               fillcolor = '#f4a261')
figMSNBC <- figMSNBC %>% add_trace(y = ~Election, name = 'Election', 
                               fillcolor = '#e76f51')
figMSNBC <- figMSNBC %>% layout(title = 'Segment counts, MSNBC, by topic and week',
                            xaxis = list(title = "Week of",
                                         showgrid = FALSE),
                            yaxis = list(title = "Count",
                                         showgrid = TRUE))
figMSNBC