ADVERTISEMENT



Google       

Home -> Law Blog Directory -> Legal Research Blogs -> Jason the Content Librarian

OR PHONE (866) 635-1838 for Bankruptcy Help, (866) 635-6190 for Divorce,
(866) 635-2689 for Personal Injury or (866) 635-9402 for Criminal Defense

Find a Local Lawyer

Bankruptcy (866) 635-1838
Divorce (866) 635-6190
Personal Injury (866) 635-2689
Criminal Defense (866) 635-9402

Bookmark

Legal Research

: Jason the Content Librarian

Calicon09 Word Cloud

By Jason

ADVERTISEMENTS

I created a word cloud for the #calicon09 tweets with Wordle.

calicon09

Thanks to Yankee in Canada for the idea.

Here’s how I did it:

1. Used the twitter API to access the tweets with the #calicon09 hash tag in a json format.

2. Based on some code found around the interwebs, I put together some php for processing the json format.

<?php
$json = file_get_contents(”http://search.twitter.com/search.json?q=%23calicon09&rpp=100&page=1″, true); //getting the file content
$decode = json_decode($json, false); //getting the file content as array
foreach ( $decode->results as $results )
{
echo “{$results->text}\n”;
}
echo “<pre>”;
print_r($decode);
$count = count($decode);
print_r($count);
echo “</pre>”;
$text = $array['results']['text'];
print_r($text)
?>

<?php
$json = file_get_contents(”http://search.twitter.com/search.json?q=%23calicon09&rpp=100&page=1″, true); //getting the file content
$decode = json_decode($json, false); //getting the file content as array
foreach ( $decode->results as $results )
{
echo “{$results->text}\n”;
}
?>

Note the api for twitter only returns certain numbers of results per page. I had to run a few pages at 100 results per page to get all the tweets. I know there are ways to automate this, but it’s a little beyond me at the moment, and this was fine for this particular task.

3. Drop the text of all the tweets into a text editor.

4. Shaped the data. I removed the tag #calicon09, removed @usernames, and a few other stop words. I’m sure I could remove more, but I think the resulting cloud is nice.

5. Paste the text into Wordle’s full text form.

I’m sure people may find some problems with the way I cobbled this together. I welcome constructive comments.

Full post as published by Jason the Content Librarian on July 01, 2009 (boomark / email).

Bloggers, promote your law blog by nominating your blog for inclusion in USLaw.com's Law Blog Directory and RSS Reader. Benefits described.
Related Searches

























































































































US Law
#1 Online Legal Resource













Your Blog Subscriptions
Subscribe to blogs

10,000+ Law Job Listings
Lawyer . Police . Paralegal . Etc
Earn a law-related degree
Are you the author of this blog? Adding USLaw.com to your Blogroll increases relevance. You qualify to display a USLaw Network badge.
Suggest changes to this blog's description or nominate another for inclusion. Register for updates.


Practice Area
Zip Code:

Contact a Lawyer Now!






0.0031 secs (from cache 10/31/26 03:56:41)