Monitoring Brexit tweets in real time

Caio Moreno
2 min readMar 16, 2019

--

It is hard to believe, but it seems that #brexit will happen in some days and it will affect all the world. Are we ready?

I decided to build a simple tool for real time monitoring of tweets with the hashtags #brexit, #StopBrexit #LeaveEU, #RemainEU, #RevokeArticle50, #PeoplesVote, #MarchforLeave

In this simple experiment I used the power of the Cloud to ingest and analyse data in real time.

Test: I used my own twitter account to test if I was getting tweets.

And it did work, as we can see.

Another test message and the message appear in seconds.

In some minutes I collected 3069 tweets using the real time streaming api from twitter.

As we can see we have people with more then 2 million followers tweeting about Brexit during the short period of my experiement.

Some SQL queries used for the experiment:

SELECT
tweets.text,
tweets.created_at,
tweets.source,
tweets.user.name,
tweets.user.id,
tweets.user.screen_name,
tweets.user.location,
tweets.user.followers_count
FROM tweets
order by tweets.user.followers_count DESC

Filter by user (caiomsouza)

SELECT
tweets.text,
tweets.created_at,
tweets.source,
tweets.user.name,
tweets.user.id,
tweets.user.screen_name,
tweets.user.location,
tweets.user.followers_count
FROM tweets
where tweets.user.screen_name = 'caiomsouza'

Order by the last tweets

SELECT
tweets.text,
tweets.created_at,
tweets.source,
tweets.user.name,
tweets.user.id,
tweets.user.screen_name,
tweets.user.location,
tweets.user.followers_count
FROM tweets
order by tweets.created_at DESC

--

--

Caio Moreno
Caio Moreno

Written by Caio Moreno

Solutions Architect @databricks | Professor | PhD | Ex-Microsoft | Ex-Avanade/Accenture | Ex-Pentaho/Hitachi | Ex-AOL | Ex-IT4biz CEO. (Opinions are my own)

No responses yet