An open API service indexing awesome lists of open source software.

https://github.com/mdb/gram

View one's recent Instagram media, with CORS support
https://github.com/mdb/gram

Last synced: 9 months ago
JSON representation

View one's recent Instagram media, with CORS support

Awesome Lists containing this project

README

          

[![Actions Status](https://github.com/mdb/gram/workflows/CI/badge.svg)](https://github.com/mdb/gram/actions)

# gram

A micro-y service for fetching one's recent Instagram media, with CORS support.

## Running

```
export IG_ACCESS_TOKEN=
```

```
npm install
npm run start
```

## Usage

`gram` has 2 endpoints:

1. `GET /` - a basic health check

Example:

```bash
curl http://localhost:3000
{"message":"hello world"}
```

2. `GET /recent-media` - get the 8 most recent media posts from the Instagram user with whom the `IG_ACCESS_TOKEN` is associated:

Example:
```bash
curl http://localhost:3000/recent-media | jq -r '.[0].permalink'
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 12652 100 12652 0 0 40194 0 --:--:-- --:--:-- --:--:-- 40292
https://www.instagram.com/p/CEbmnwBDYMR/
```

## Development & Testing

```
npm install
npm test
```

## Deploying to Heroku

Assuming you have a [Heroku](http://heroku.com/) account and the `heroku` CLI...

1. login: `heroku login`
2. create an app: `heroku create`
3. deploy: `git push heroku master`
4. configure an access token: `heroku config:set IG_ACCESS_TOKEN=`
5. give your app a custom name (optional): `heroku apps:rename `