library(tidyverse)
library(tidytext)
library(wordcloud)
library(knitr)
library(RColorBrewer)
library(atrrr)
library(kableExtra)
The project examines Bluesky posts about the band Radiohead. The goal is to obtain the latest public posts, clean the text, extract the most popular words and generate visualizations that summarize the main topics of conversation. Looking at word frequencies, you can find out what songs, albums, events or opinions are typically connected with Radiohead in Bluesky chats.
The reason Bluesky was chosen as the data source is that on the platform users publicly discuss music, artists, concerts and entertainment news. I used the atrrr package to connect R to the Bluesky API to search for posts in English that contained the term “Radiohead.” The analysis requested 200 recent posts usable for cleaning.
search_topic <- "Radiohead"
search_topic
## [1] "Radiohead"
bluesky_posts_raw <- search_post(
q = search_topic,
limit = 200,
sort = "latest",
lang = "en"
)
nrow(bluesky_posts_raw)
## [1] 200
The search_post() function searches Bluesky for posts
related to the selected topic. The limit argument requests
approximately 200 posts, while sort = "latest" asks for
recent results.
bluesky_posts_clean <- bluesky_posts |>
filter(!is.na(post_text)) |>
mutate(
post_text = str_squish(post_text)
) |>
filter(post_text != "") |>
distinct(post_text, .keep_all = TRUE)
nrow(bluesky_posts_clean)
## [1] 189
This step removes missing posts, blank text, unnecessary spaces, and duplicate posts.
| Search Term | Total Posts | Unique Authors | Total Likes | Average Likes | Total Reposts | Total Replies |
|---|---|---|---|---|---|---|
| Radiohead | 189 | 158 | 645 | 3.41 | 34 | 70 |
top_words <- word_frequency |>
slice_max(
order_by = n,
n = 10,
with_ties = FALSE
)
| Word | Frequency |
|---|---|
| indie | 19 |
| song | 19 |
| listen | 18 |
| radio | 15 |
| rock | 15 |
| vortex | 15 |
| playing | 14 |
| pop | 14 |
| album | 13 |
| creep | 12 |
The table identifies the ten most frequently used words in the collected posts.
The bar chart to compare the exact frequencies of the most common words.
The word cloud displays the most frequently used meaningful words in the Radiohead posts. Larger words appeared more often in the collected data.
bigrams |>
slice_head(n = 10) |>
kable(
col.names = c("Two-Word Phrase", "Frequency"),
caption = "Most Common Two-Word Phrases in Radiohead Posts"
) |>
kable_styling(
bootstrap_options = c("striped", "hover"),
full_width = FALSE,
position = "left"
)
| Two-Word Phrase | Frequency |
|---|---|
| indie pop | 6 |
| classic rock | 5 |
| discord vortexwave | 5 |
| indie indie | 5 |
| indie rock | 5 |
| listen vortex | 5 |
| pop indie | 5 |
| radio join | 5 |
| rock classic | 5 |
| vortex indie | 5 |
Two-word phrases can provide more context than individual words. For example, an album title or song name may be easier to understand when the words remain together.
The analysis looked at 189 usable Bluesky posts about Radiohead and found that the most common meaningful words were “indie,” “song,” “listen,” and “radio.” Most of the conversations seemed to be about Radiohead’s music, songs, releases, performances or recent news. The bar chart and the word cloud gave similar results as the biggest words in the word cloud were also the most used words. The two word phrase table gave more context as it showed which words were used together. Overall the results provide a helpful overview of what the main topics people were talking about.
The project only considers public posts returned by the Bluesky search function. Some posts might include the word Radiohead in a link preview, image caption or another field, but not in the main text. The analysis also removes common words, without taking into account the context of their use. Word-frequency analysis can’t tell you the sentiment of what was said.
In this project I scraped social media posts from Bluesky using R and
the atrrr package. I cleaned and split the posts into
single words and did a word frequency analysis. This allowed me to see
what words were used most with the band Radiohead. I was able to
identify what people commonly talked about through charts which made it
easier to analyze social media text data. I would add sentiment analysis
in the future to determine whether the posts were positive, negative or
neutral.
Arzheimer, K. (2024, November 19). How to access the Bluesky API from R, fast.
Gruber, J. B., Guinaudeau, B., and Votta, F. atrrr: Access the Bluesky Social API from R.
Bluesky. Bluesky Social and AT Protocol documentation.