13
DATA MINING THE TWITTER API 2012 ALAO Annual Conference Friday, October 26, 12

Data Mining the Twitter API: 2012 ALAO Annual Conference

Embed Size (px)

Citation preview

Page 1: Data Mining the Twitter API: 2012 ALAO Annual Conference

DATA MINING THE TWITTER API2012 ALAO Annual Conference

Friday, October 26, 12

Page 2: Data Mining the Twitter API: 2012 ALAO Annual Conference

THE AGE OF BIG DATAPhotograph by Max Dannenbaum/Getty Images

Friday, October 26, 12

Page 3: Data Mining the Twitter API: 2012 ALAO Annual Conference

“It’s a revolution... We’re just getting under way. But the march of quantification, made possible by enormous new sources of data, will sweep through academia, business and government. There is no area that is going to be untouched.”

Gary King, DirectorInstitute for Quantitative Social Science, Harvard University

Friday, October 26, 12

Page 4: Data Mining the Twitter API: 2012 ALAO Annual Conference

Industrial Equipment

Automobiles

Water MetersElectric Meters

Household Appliances

Traffic

Weather

Government Data

Search Traffic

Wordpress posts

Tumblr posts

Instagrams

Tweets

Friday, October 26, 12

Page 5: Data Mining the Twitter API: 2012 ALAO Annual Conference

Why do we want these Tweets?

Discover & respond to user needs proactivelyCreate social rapport with users

Build social capitalAdd followers

Gain unique insight into Zeitgeist of user baseCapture as an additional data point

Vertical scroll

Friday, October 26, 12

Page 6: Data Mining the Twitter API: 2012 ALAO Annual Conference

Friday, October 26, 12

Page 7: Data Mining the Twitter API: 2012 ALAO Annual Conference

DATA ACCESSThe Neighbor’s Garage Analogy

Open Source: take whatever you want, use however you want

Proprietary: pay for each tool in the garage, use them as designed

API: utilize the services of the garage, if you have authorization and ask the right way

Friday, October 26, 12

Page 8: Data Mining the Twitter API: 2012 ALAO Annual Conference

High-Level OverviewBuild URL request with keywords and other parameters

Submit URL requestConvert returned JSON data

Insert non-duplicative data into MySQL table

Display data by pulling out of MySQL table

<?php ?>

<?php mysql ?>

<?php mysql html css ?>Friday, October 26, 12

Page 9: Data Mining the Twitter API: 2012 ALAO Annual Conference

DISPLAY DATA BY PULLING OUT OF MYSQL TABLE

<?php

echo '<head>';

echo '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';

echo '<link rel="stylesheet" href="style.css" type="text/css" />';

echo '</head>';

echo '<body>';

mysql_connect("localhost", "user", "pass") or die(mysql_error());

mysql_select_db("database") or die(mysql_error());

$tweet_archive = mysql_query("SELECT * FROM twindicators where loc NOT LIKE '%Beach%' ORDER BY id DESC");

echo '<div class="content">';

while ($row = mysql_fetch_array($tweet_archive)) {

$decoded_text = urldecode($row["text"]);

echo '<p><span class="user">' . $row[user] . '</span> | <span class="date">' . $row[date] . '</span> <br /><br /> <span class="text"><a href="https://twitter.com/#!/' . $row[user] . '/status/' . $row[twid] . '">' . $decoded_text . echo '<hr />';

}

echo '</div>';

echo '</body>';

?>

Friday, October 26, 12

Page 10: Data Mining the Twitter API: 2012 ALAO Annual Conference

NOTABLE INTERACTIONS

70 followers

Friday, October 26, 12

Page 11: Data Mining the Twitter API: 2012 ALAO Annual Conference

Future Developments

Develop a deeper set of keywordsDevelop a richer interface for librarians

Incorporate SMS notifications to subject specific librarians when relevent tweet is recorded

Analyze data for user satisfaction / areas for improvement

Friday, October 26, 12

Page 12: Data Mining the Twitter API: 2012 ALAO Annual Conference

SHAMELESS PLUGWeb Service APIs and Libraries. ALA Editions

Friday, October 26, 12

Page 13: Data Mining the Twitter API: 2012 ALAO Annual Conference

DETAILS & SUCH

Jason Paul [email protected]@jpmichel

Code:Query and store: https://gist.github.com/3846007Display: https://gist.github.com/3846055

Friday, October 26, 12