https://github.com/averagemarcus/twitter-profile-pic
https://github.com/averagemarcus/twitter-profile-pic
Last synced: over 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/averagemarcus/twitter-profile-pic
- Owner: AverageMarcus
- Created: 2020-12-09T13:02:18.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-03-21T16:02:24.000Z (over 5 years ago)
- Last Synced: 2025-02-12T11:24:09.407Z (over 1 year ago)
- Language: HTML
- Size: 74.2 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README

> Get a twitter profile pic using a given handle
Available at https://twitter-profile-pic.cluster.fun/
## Features
* Multiple image size support (currently supported: `normal`, `bigger`, `mini`, `original`, `200x200`, `400x400`)
* JSON support using `application/json` content type header
* Returns a default profile pic for unknown users
## Example: HTML
Code:
```
```
Result:

## Example: JSON
cURL Request:
```
curl -X GET \
https://twitter-profile-pic.cluster.fun/marcus_noble_ \
-H 'cache-control: no-cache' \
-H 'content-type: application/json' \
-H 'postman-token: 680d968e-9b13-85c8-f7d5-9b48a333702f'
```
Result:
```
{
"normal": "https://pbs.twimg.com/profile_images/776738772759277569/hfaM5zhA_normal.jpg",
"bigger": "https://pbs.twimg.com/profile_images/776738772759277569/hfaM5zhA_bigger.jpg",
"mini": "https://pbs.twimg.com/profile_images/776738772759277569/hfaM5zhA_mini.jpg",
"original": "https://pbs.twimg.com/profile_images/776738772759277569/hfaM5zhA.jpg",
"200x200": "https://pbs.twimg.com/profile_images/776738772759277569/hfaM5zhA_200x200.jpg",
"400x400": "https://pbs.twimg.com/profile_images/776738772759277569/hfaM5zhA_400x400.jpg"
}
```
## Requirements
[Redis](https://redis.io/) is required if caching is wanted. You will also need Twitter credentials that can be created here: [https://apps.twitter.com/](https://apps.twitter.com/)
Environment Variables:
```
TWITTER_CONSUMER_KEY=
TWITTER_CONSUMER_SECRET=
TWITTER_ACCESS_TOKEN_KEY=
TWITTER_ACCESS_TOKEN_SECRET=
REDIS_URL=
```