Skip to content

RodolfoFerro/TwHashtagsVis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Twitter hashtags visualization

Main goals:

  1. Gather Twitter user's hashtags and analyze them.
  2. Visualize data in a creative way.

Setup

First clone the repo. I'm using Python 3.6 with the following packages:

To install all dependencies create a virtual env and run:

pip install -r requirements.txt

Now that we have all the requirements, we need to create a Twitter App.

Creating a Twitter App

In order to extract tweets for a posterior analysis, we need to access to our Twitter account and create an app. The website to do this is https://apps.twitter.com/. (If you don't know how to do this, you can follow this quick tutorial video to create an account and an application.)

From this app that we're creating we will save the following information the credentials.py script:

  • Consumer Key (API Key)
  • Consumer Secret (API Secret)
  • Access Token
  • Access Token Secret

The content of this script is the following:

# ===============================================================
# Author: Rodolfo Ferro Pérez
# Email: ferro@cimat.mx
# Twitter: @FerroRodolfo
#
# Script: Access keys for Twitter App.
#
# ABOUT COPYING OR USING PARTIAL INFORMATION:
# This script was originally created by Rodolfo Ferro. Any
# explicit usage of this script or its contents is granted
# according to the license provided and its conditions.
# ===============================================================

# Consumer:
CONSUMER_KEY = ''
CONSUMER_SECRET = ''

# Access:
ACCESS_TOKEN = ''
ACCESS_SECRET = ''

How to use it

Wanna see it in action?

Feel free to check the demo notebook from the repo or directly from Jupyter nbviewer!

Example of visualization (mask/wordcloud)

An example of visualization of hashtags from @pybites using a mask of the Twitter bird is the following one:

About

Twitter hashtags visualization.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published