turbot/twitter

steampipe plugin install twittersteampipe plugin install twitter

Table: twitter_user_following

Query which users the specified user follows.

Note: The user_id field must be provided.

Examples

List the follows for a user

select
*
from
twitter_user_following
where
user_id = '1318177503995985921' -- @steampipeio

List follows by username

Via subselect:

select
uf.id,
uf.username
from
twitter_user_following as uf
where
uf.user_id in
(
select
id
from
twitter_user
where
username = 'steampipeio'
)

Find all users followed by both turbothq and nathanwallace

select
id,
username
from
twitter_user_following
where
user_id in (select id from twitter_user where username = 'turbothq')
intersect
select
id,
username
from
twitter_user_following
where
user_id in (select id from twitter_user where username = 'nathanwallace')

Find users who follow you, but you don't follow them

with account as
(
select
id
from
twitter_user
where
username = 'turbothq'
)
,
following as
(
select
id,
username
from
twitter_user_following
where
user_id in
(
select
id
from
account
)
)
,
followers as
(
select
id,
username
from
twitter_user_follower
where
user_id in
(
select
id
from
account
)
)
select
username
from
followers
where
username not in
(
select
username
from
following
)
order by
username

.inspect twitter_user_following

List of users the specified user ID is following.

NameTypeDescription
created_attimestamp without time zoneThe UTC datetime that the user account was created on Twitter.
descriptiontextThe text of this user's profile description (also known as bio), if the user provided one.
entitiesjsonbEntities are JSON objects that provide additional information about hashtags, urls, user mentions, and cashtags associated with the description.
idtextThe unique identifier of this user.
locationtextThe location specified in the user's profile, if the user provided one. As this is a freeform value, it may not indicate a valid location, but it may be fuzzily evaluated when performing searches with location queries.
nametextThe name of the user, as they’ve defined it on their profile. Not necessarily a person’s name.
pinned_tweetjsonbContains withholding details for withheld content, if applicable.
pinned_tweet_idtextUnique identifier of this user's pinned Tweet.
profile_image_urltextThe URL to the profile image for this user, as shown on the user's profile.
protectedtextIndicates if this user has chosen to protect their Tweets (in other words, if this user's Tweets are private).
public_metricsjsonbContains details about activity for this user.
urltextThe URL specified in the user's profile, if present.
user_idtextID of the user who is followed by these users.
usernametextThe Twitter screen name, handle, or alias that this user identifies themselves with. Usernames are unique but subject to change.
verifiedbooleanIndicates if this user is a verified Twitter User.
withheldjsonbContains withholding details for withheld content, if applicable.