https://github.com/mdb/ig-alerter
Text message subscriptions to a user's Instagram posts!
https://github.com/mdb/ig-alerter
Last synced: 12 days ago
JSON representation
Text message subscriptions to a user's Instagram posts!
- Host: GitHub
- URL: https://github.com/mdb/ig-alerter
- Owner: mdb
- Created: 2015-12-11T13:39:24.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2015-12-12T12:00:21.000Z (over 10 years ago)
- Last Synced: 2025-04-17T16:55:28.613Z (about 1 year ago)
- Language: JavaScript
- Size: 2.93 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ig-alerter
Text message subscription to a user's Instagram posts!
## Dependencies
* an [Instagram](https://www.instagram.com/developer/clients/manage/) client id & client secret
* a [Twilio](https://www.twilio.com/) account SID & a Twilio account auth token
* a Twilio phone number that can send text messages
* The [Instagram ID](http://jelled.com/instagram/lookup-user-id) of the user you'd like subscribe to
* a phone number that can receive text messages
* [Node.js](https://nodejs.org/en/)
## Example
For example, to receive a text message each time [jinxedstore](https://www.instagram.com/jinxedstore/) posts new Instagram media...
Clone and enter the repo:
```
git clone https://github.com/mdb/ig-alerter.git && cd ig-alerter
```
Establish the following in a `.env` file:
```
IG_CLIENT_ID=
IG_CLIENT_SECRET=
IG_USER_ID=
CALLBACK_URL=http:///alert
TWILIO_ACCOUNT_SID=
TWILIO_AUTH_TOKEN=
TWILIO_PHONE_NUMBER=
PHONE_NUMBER=
```
Install npm dependencies:
```
npm install
```
Run the server:
```
npm start
```
### How do I develop locally if this requires a public URL?
On startup, the application will attempt to to perform the necessary
IG handshake with Instagram's [subscriptions API](https://www.instagram.com/developer/subscriptions/).
This requires your `ig-alerter` -- and its `CALLBACK_URL` -- to be publicly available to Instagram.
[ngrok](https://ngrok.com/) can be used to expose your local development environment to a public URL.
For example, to make port 3000 publicly available via `ngrok`:
```
ngrok 3000
```
This prints output like the following:
```
ngrok (Ctrl+C to quit)
Tunnel Status online
Version 1.7/1.7
Forwarding https://4d6812ed.ngrok.com -> 127.0.0.1:3
Forwarding http://4d6812ed.ngrok.com -> 127.0.0.1:30
Web Interface 127.0.0.1:4040
# Conn 1
Avg Conn Time 11.07ms
HTTP Requests
-------------
GET /alert 200 OK
```
The ngrok `Forwarding` URL can be used to set to the value of your `CALLBACK_URL` in your `.env` file:
```
...
CALLBACK_URL=https://4d6812ed.ngrok.com/alert
...
```