Skip to Main Content
Haskell Data Analysis cookbook
book

Haskell Data Analysis cookbook

by Nishant Shukla
June 2014
Beginner to intermediate content levelBeginner to intermediate
334 pages
6h 8m
English
Packt Publishing
Content preview from Haskell Data Analysis cookbook

Streaming Twitter for real-time sentiment analysis

Twitter is flooded with content that arrives every second. A great way to start investigating real-time data is by examining tweets.

This recipe will show how to write code that reacts to tweets relating to a specific search query. We use an external web-endpoint to determine whether the sentiment is positive, neutral, or negative.

Getting ready

Install the twitter-conduit package:

$ cabal install twitter-conduit

For parsing JSON, let's use yocto:

$ cabal install yocto

How to do it…

Follow these steps to set up the Twitter credentials and begin coding:

  1. Create a new Twitter app by navigating to https://apps.twitter.com.
  2. Find the OAuth Consumer Key and OAuth Consumer Secret from this Twitter Application ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Haskell Quick Syntax Reference: A Pocket Guide to the Language, APIs, and Library

Haskell Quick Syntax Reference: A Pocket Guide to the Language, APIs, and Library

Stefania Loredana Nita, Marius Mihailescu

Publisher Resources

ISBN: 9781783286331Supplemental Content