Skip to content

Data Source: Twitter

Matt Holt edited this page Feb 17, 2019 · 7 revisions

This data source adds your tweets and media from Twitter to your timeline. The username you specify for this service MUST be your Twitter screen name.

By default, replies to tweets other than your own are NOT stored, but you can include all your other reply tweets with the -twitter-replies flag.

By default, retweets are NOT stored, but you can enable these with the -twitter-retweets flag.

Important note: The Twitter API severely limits how far back in time or number of tweets it can go (for free). I recommend first importing your entire Twitter timeline to date with a Twitter data archive that you can export from your Twitter account, and then using get-latest to use the API thereafter.

Note that inline links will be expanded from their t.co form into the full URL. Also, embedded tweets (tweets which are linked to) are added to the timeline as separate items, but with a "quotes" relationship joining the two.

Twitter
Site https://www.twitter.com
Listing Mode ✅ Download via API
✅ Import from file
Data Source ID twitter
Authentication OAuth2
OAuth2 Provider ID twitter
OAuth2 App Config
[oauth2.providers.twitter]
client_id = "YOUR_APP_CONSUMER_API_KEY"
client_secret = "YOUR_APP_CONSUMER_API_SECRET"
token_url = "https://api.twitter.com/oauth2/token"

Obtaining the data file from Twitter

  1. Go to https://twitter.com/settings/your_twitter_data
  2. Under "Download your Twitter data", enter your password and click Confirm.
  3. Follow the instructions, wait, then download your archive in .zip format.

Importing your Twitter data

If you haven't done so already, add your Twitter account (you must use your screen name):

$ timeliner add-account twitter/you

Then just import the .zip file:

$ timeliner import /path/to/twitter-archive.zip twitter/you

Getting your Twitter data from the API

After you've imported your Twitter data from the archive (not required, but might be the only way to get all your older content), you can use the API.

First you'll need to make a Twitter API "app" to get credentials to access their API. Instructions here.

Once your app credentials are in your config file, get the latest data:

$ timeliner get-latest twitter/you

Of course, you can also use get-all but if you've already imported all your data to this point, get-latest will have the same net effect and will finish sooner.

Caveats

  • The Twitter API is only able to download the last ~3K tweets due to API restrictions, so downloading historical data through the import file will still be necessary at first.

  • If your screen name changes, I'm not quite sure what will happen. We would use the unchanging user ID instead, except Twitter doesn't really expose that except through the API.

  • Twitter archives significantly downgrade the quality and resolution of images. TODO: We may be able to try accessing the full image over the network from its URL, if it still exists online, but I'm not sure if they're actually any higher-res.


Note: Timeliner does not duplicate the functionality of Twitter or the official Twitter apps.