steampipe plugin install twitter

Table: twitter_user_following - Query Twitter User Followings using SQL

Twitter User Following is a feature within Twitter that allows a user to follow other Twitter users, thereby receiving their tweets and updates. It is a way for users to curate their Twitter feed based on their interests and preferences. This feature forms a fundamental part of the Twitter social media platform, enabling user interaction and engagement.

Table Usage Guide

The twitter_user_following table provides insights into the users that a specific Twitter user is following. As a Social Media Analyst, explore user-specific details through this table, including the list of users they follow, their interests, and their engagement. Utilize it to understand user behavior, their preferences, and to create targeted marketing strategies.

Important Notes

  • The user_id field must be set in the where clause.

Examples

List the follows for a user

Discover the segments that a specific user is following on Twitter, providing insights into their interests and affiliations. This can be useful for social media analysis and targeted marketing strategies.

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

List follows by username

Discover the segments that are followed by a specific Twitter user, enabling you to gain insights into their interests and connections. This could be beneficial in understanding their network and potential influence. 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'
);
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

Discover the shared connections between two specific Twitter users to understand their common interests or potential collaborations. This can be beneficial in social media analysis or targeted marketing strategies.

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'
);
select
id,
username
from
twitter_user_following
where
user_id in (
select
id
from
twitter_user
where
username = 'turbothq'
)
union
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

Discover the segments of your Twitter audience that follow your account, but whom you have not followed back. This can be useful for identifying potential influencers or key accounts to engage with for networking and community-building purposes.

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;
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;

Schema for twitter_user_following

NameTypeOperatorsDescription
_ctxjsonbSteampipe context in JSON form.
created_attimestamp with 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.
sp_connection_nametext=, !=, ~~, ~~*, !~~, !~~*Steampipe connection name.
sp_ctxjsonbSteampipe context in JSON form.
urltextThe URL specified in the user's profile, if present.
user_idtext=ID 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.

Export

This table is available as a standalone Exporter CLI. Steampipe exporters are stand-alone binaries that allow you to extract data using Steampipe plugins without a database.

You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_export_installer.sh script:

/bin/sh -c "$(curl -fsSL https://steampipe.io/install/export.sh)" -- twitter

You can pass the configuration to the command with the --config argument:

steampipe_export_twitter --config '<your_config>' twitter_user_following