The assignment is to design, implement, test, and document an application to analyse the results of a Facebook search using the Graph API: e.g. Trending Topics of Facebook Status Updates. A Facebook Status Update, sometimes referred to as a Post, allows users to post messages for their friends to read. In turn, friends can respond with their own comments, as well as clicking the "Like" button.1 Facebook users post all sorts of information in status updates and by examining the contents of and detecting which words appear frequently across posts we can detect trending topics. See below for more information on Facebook and the API that generate the list of posts used in this assignment:
Wikipedia on Facebook: http://en.wikipedia.org/wiki/Facebook
Facebook Developer Graph API: https://developers.facebook.com/docs/graph-api/using-graph-api/v2.3
Facebook Graph API Post Object: https://developers.facebook.com/docs/graph-api/reference/v2.3/post
The goal of phase 1 is to parse a Facebook Post data string in into a Post object. You will need to at least:
Figure 1. See image.
Phase 2 is to sort Posts by different features of your newly created Post object (e.g. User, Date, etc.). You will need to at least be able to sort Posts based on
You can use the static methods of the utility class Collections to sort your posts.
Create further unit tests using the supplied data files to verify that your sorting works.
You will need to update the graphical user interface to reflect the changes you have made (i.e. being able to sort posts). Figure 2 is a very basic example of an updated graphical user interface. See image.
The task of phase 3 is to implement a trending topic analyser for the list of posts. This amounts to indexing the word usage across the text of the posts. A simple way to do this is to count the number of times a single word appears in the list of posts. Figure 3 lists a pseudo code example for indexing the words used in posts.
SomeCollection words (this could be a set, list, map, etc)
for each post
for each word in post
if (word is in words)
increment count for word in words
add word to words and set count to 1
associate post with word
NOTE: in this example the word is not cleaned in anyway (e.g. all punctuation symbols are included in the word, twinkle, is NOT the same as twinkle) and it counts multiple occurrences of a word in a post. Your indexer should meet this specification. If you improve upon it you should still make available this implementation for testing.
Once indexed, you need to be able to
You will need to use classes from the Collections framework such as Lists, Maps and Sets to implement this algorithm. You may need to create a new class to store the information about a word, e.g. the word itself, the count, the posts associated with it.
Create further unit tests using the supplied data files to verify that your trending topic algorithm works. The supplied data assumes the above algorithm is implemented as specified.
You will need to update the graphical user interface to allow the user to index the posts and display the results (e.g. Figure 4) See image.
It is expected that you will thoroughly test your application using unit testing. The unit tests will not test your graphical user interface, but will test the classes you build to represent the posts and other pieces of data (e.g. words in the index, comparators, lists) and the functionality associated with them (sorting, find most used word, getting the user of post). This will make your underlying classes somewhat separate from your user interface and build a more robust and reusable application (e.g. you could use the classes with another user interface such as a mobile device).
You will be provided with a set of data files and the expected output that you can use in your unit tests.
You should write a brief document to describe the features of your application. You can include text from this document, but most importantly you need to describe any additional features that you have implemented that might not be obvious. For example, include information on any interesting algorithms you implemented to index the posts.
This document can be thought of as an informal user guide.