Code Monkey home page Code Monkey logo

twitteranalysis's Introduction

Triathlon API Twitter Keyword and Sentiment Analysis with MonkeyLearn.

This is a quick and dirty script to quickly run keyword and sentiment analysis of event tweets via the [Triathlon API] (https://developers.triathlon.org) and MonkeyLearn. It is in no way meant for production usage.

  • Step 1: Get a Triathlon API key from the Triathlon API Management Portal
  • Step 2: Get a Monkey Learn API key from here
  • Step 3: Clone this repo and replace config.php with your API keys obtained in steps 1 & 2 and the event hashtag you wish to analyse (all events may not be available)
  • Step 4a: Download composer if not on your local system
  • Step 4b: Run composer install
  • Step 5: Run the script on the command line with php -f keywords.php to output the results of the keyword analysis

The result of the keyword analysis will produce the top 10 keywords, the number of times they occurred and the relevance (1 being the highest). Note that this analysis was performed on a very small number of tweets for an example.

Keyword | Count | Relevance
weekend | 13 | 0.984
Saturday | 14 | 0.849
American Sarah True | 2 | 0.816
athletes | 9 | 0.751
RACE WEEK | 3 | 0.734
WTS schedule | 3 | 0.734
Alistair Brownlee | 3 | 0.734
WTS podiums | 3 | 0.734
Sweden Stockholm | 3 | 0.734
Jonathan Brownlee | 3 | 0.734

You may also run a sentiment analysis php -f sentiment.php which will yield a result similar to the following:

Positive: 23
Negative: 1
Neutral: 62
Negative Tweet Results
Unfortunately due to illness @Jgomeznoya will not compete in #WTSStockholm this wknd. Wishing him a speedy recovery! https://t.co/Tg2Bl2cnTO

twitteranalysis's People

Contributors

garethtdavies avatar

Stargazers

Federico Pascual avatar

Watchers

James Cloos avatar Troy Tucker avatar Federico Pascual avatar

Forkers

feconroses

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.