Database Reference
In-Depth Information
Listing 2.3
A sample Twitter user object
{
"location"
:
"Tempe,AZ"
,
"default_profile"
: true,
"statuses_count"
:1,
"description"
:
"Twitter Data Analytics is a topic for
practitioners and researchers interested in
investigating Twitter data."
,
"verified"
: false,
"name"
:
"DataAnalytics"
,
"created_at"
:
"Tue Mar 12 18:43:47 +0000 2013"
,
"followers_count"
:1,
"geo_enabled"
: false,
"url"
:
"http://t.co/HnlG9amZzj"
,
"time_zone"
:
"Arizona"
,
"friends_count"
:6,
"screen_name"
:
"twtanalyticsbk"
,
//Other user fields
...
}
Using the API
users/show
,
5
a user's profile information can be retrieved using
the method
GetProfile
. The method is presented in Listing
2.2
. It accepts a valid
username
as a parameter and fetches the user's Twitter profile.
Key Parameters
: Each user on Twitter is associated with a unique id and a
unique Twitter handle which can be used to retrieve his profile. A user's Twitter
handle, also called their screen name (
screen_name
), or the Twitter ID of the
user (
user_id
), is mandatory. A typical user object is formatted as in Listing
2.3
.
Rate Limit
: A maximum of 180 API calls per single user and 180 API calls from
a single application are accepted within a single rate limit window.
Note:
User information is generally included when Tweets are fetched from
Twitter. Although the Streaming API does not have a specific endpoint to retrieve
user profile information, it can be obtained from the Tweets fetched using the API.
2.3
Collecting a User's Network
A user's network consists of his connections on Twitter. Twitter is a directed network
and there are two types of connections between users. In Fig.
2.3
, we can observe an
example of the nature of these edges. John follows Alice, therefore John is Alice's
follower. Alice follows Peter, hence Peter is a friend of Alice.