twitter-profile-media

Get twitter profile image and banner

Usage no npm install needed!

<script type="module">
  import twitterProfileMedia from 'https://cdn.skypack.dev/twitter-profile-media';
</script>

README

twitter-profile-media Build Status

Get twitter profile image and banner

Install

npm install --save twitter-profile-media

Usage

import media from 'twitter-profile-media';
import tokens from 'twitter-tokens';

media(tokens, 'twitter').then(({ image, banner }) => {
  image;  // https://pbs.twimg.com/profile_images/615680132565504000/EIpgSD2K.png
  banner; // https://pbs.twimg.com/profile_banners/783214/1436401887
});

API

media(tokens, username)

Return a promise that resolves to user profile image and banner.

tokens

Type: object

Valid twitter tokens (dev credentials). You can use twitter-tokens to simplify getting tokens.

username

Type: string

Twitter username.

Related

License

MIT