Social-Media Abstractions contain the necessary classes for mapping a number of social networks' wrappers to a single representation.
The project includes three set of packages, `eu.socialsensor.framework.streams`, `eu.socialsensor.framework.retrievers` and `eu.socialsensor.framework.abstractions` to be used for retrieving content from several social networks by calling their corresponing API's methods: Twitter, Facebook, Instagram, DailyMotion, Flickr, Twitpic, Google+, Tumblr, Vimeo and Youtube API.-
Streams are responsible for setting up the social stream according to the credentials that the user has provided and creating/closing the connection to the network in order to perform api calls. Specifically the individual streams that correspond to each social network implement the abstract class
eu.socialsensor.framework.streams.Stream
, whose basic operations are the following :-
Opens the stream
public abstract void open(StreamConfiguration config) throws StreamException;
-
Starts the retrieval process with a given input
public Integer search(List<Feed> feeds) throws StreamException;
-
Closes the stream after the retrieval process is completed
public abstract void close() throws StreamException;
-
-
Retrievers are basicaly the wrappers to the social networks APIs, whose job is to perform calls according to an input feed they have received. For example, an input feed maybe a keyword or a set of keywords (KeywordsFeed), a social network user to follow (SourceFeed), or the coordinates of the location (LocationFeed). This only applies to the social networks' APIs that behave as polling consumers. Twitter retrieves content directly from the moment the connection is established in
eu.socialsensor.framework.streams.twitter.TwitterStream
class. Due to the fact that a social network retriever can process one input feed at a time, the retrieval process can work as a multi-threaded process, where each feed is handled as a separate thread. Each social network retriever implements theeu.socialsensor.framework.retrievers.Retriever
interface, whose fundamental operations are described below :-
Receives an input feed and checks its type (Keyword/Source/Location). In the end the method will return the number of items retrieved for that feed
public List<Item> retrieve(Feed feed);
-
Calls the appropriate retrieving method in regards to the input feed's type, which performs requests to the corresponding network according to its API methods. Please note that requests by location are not supported by most APIs. The retrieving methods are the following :
public List<Item> retrieveKeywordsFeeds(KeywordsFeed feed) throws Exception; public List<Item> retrieveUserFeeds(SourceFeed feed) throws Exception; public List<Item> retrieveLocationFeeds(LocationFeed feed) throws Exception;
-
-
Finally, in Abstractions the information from the collected content is mapped to a single item representation in JSON format in order to be further handled more efficiently by the program or to be stored in the selected storages.
Abstractions project is dependent to other two SocialSensor projects :
- Socialsensor-framework-common : The project contain main classes and interfaces to be used by other SocialSensor projects
- Socialsensor-framework-client : The wrappers for handling information in/from the supported databases (MongoDB,Solr,Lucene).
Manos Schinas ([email protected]), Symeon Papadopoulos ([email protected])