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
- Host: GitHub
- URL: https://github.com/mdb/gram
- Owner: mdb
- Created: 2019-11-24T13:45:11.000Z (over 6 years ago)
- Default Branch: main
- Last Pushed: 2023-01-24T00:49:20.000Z (over 3 years ago)
- Last Synced: 2025-04-17T16:55:28.067Z (about 1 year ago)
- Language: JavaScript
- Size: 227 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[](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 `