Activity Streams Intro
posted on 14 January 2014 by stephen compston
Activity streams is an open format used to represent activities performed by actors (usually people). Gnip uses an implementation of Activity Streams to provide a normalized structure to the various types of social data we deliver.
In Gnip’s implementation of Activity Streams, each entry (e.g. Tweet, Post, Comment, Checkin…) is referred to as an “activity.” In simple terms, an “activity” represents an action taken by a user on the social platform in question. For example, a user might post a comment, or share a link, or check in to a venue.
These aspects of an activity are represented in the following manner:
|Actor||The user who is performing the action|
|Verb||The type of action being taken (e.g. post, checkin, share...)|
|Object||The 'thing' being acted upon or with (e.g. the link being shared, the comment being posted)|
These components can be applied to a vast array of activity types, while maintaining a consistent structure for consumption by apps being powered by the data.
While these fields represent the core of an Activity, many other fields fill out the context of the action being taken. For example, the postedTime indicates the publish time of the activity (or the time the action was taken), and the target provides the object to which the action was performed (e.g. the article on which the comment is being posted).
The following provide a simple description of how the Activity Streams schema is used to represent common types of social data activities.
A Tweet being posted to Twitter
- Actor: the user posting the Tweet
- Verb: “post”
- Object: The “note” being posted to Twitter
A Retweet on Twitter
- Actor: The user who clicked the “retweet” button
- Verb: “share”
- Object: The entire original Tweet, which is being retweeted. Includes information about the Actor who posted the original Tweet, and the other fields that appear for an original Tweet.
For a description of the full Activity Streams implementation for a specific Gnip source, see one of the following links: