This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const SEPARATOR = '_-_'; | |
const parseTweet = tweet => { | |
const tweetData = tweet.tweet_create_events; | |
if (typeof tweetData === 'undefined' || tweetData.length < 1) { | |
console.log('Not a new tweet event', tweetData); | |
return false; | |
} | |
const { | |
id_str: tweetId = '', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"for_user_id": "1140122800419553281", | |
"user_has_blocked": false, | |
"tweet_create_events": [ | |
{ | |
"created_at": "Wed Jan 08 17:58:58 +0000 2020", | |
"id": 1214969759399215000, | |
"id_str": "1214969759399215104", | |
"text": "@YRekognize Hello, friend https://t.co/qj1ENZUHKF", | |
"display_text_range": [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
service: you-betta-rekognize | |
package: | |
individually: true | |
plugins: | |
- serverless-bundle | |
- serverless-pseudo-parameters | |
custom: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { deleteWebhook, createWebhook, generateWebhookResponseToken } from '../services/webhook'; | |
export const register = async event => { | |
console.log(event); | |
const result = await createWebhook(); | |
console.log(result); | |
return result | |
? { statusCode: 200, body: JSON.stringify(result, null, '\t') } | |
: { | |
statusCode: 500, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
service: you-betta-rekognize | |
package: | |
individually: true | |
plugins: | |
- serverless-bundle | |
- serverless-pseudo-parameters | |
custom: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { subscribe, unsubscribe } from '../services/webhook'; | |
export const add = async event => { | |
console.log(event); | |
const result = await subscribe(); | |
return result | |
? { statusCode: 200 } | |
: { | |
statusCode: 500, | |
body: JSON.stringify({ error: 'Unable to subscribe' }), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import request from 'request-promise'; | |
import crypto from 'crypto'; | |
const { | |
API_GATEWAY_URL = '', | |
TWITTER_ACCESS_TOKEN = '', | |
TWITTER_ACCESS_TOKEN_SECRET = '', | |
TWITTER_CONSUMER_API_KEY = '', | |
TWITTER_CONSUMER_API_KEY_SECRET = '', | |
TWITTER_DEV_ENV = '', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
service: you-betta-rekognize | |
package: | |
individually: true | |
plugins: | |
- serverless-bundle | |
- serverless-pseudo-parameters | |
custom: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { deleteWebhook, createWebhook, generateWebhookResponseToken } from '../services/webhook'; | |
export const register = async event => { | |
console.log(event); | |
const result = await createWebhook(); | |
console.log(result); | |
return result | |
? { statusCode: 200, body: JSON.stringify(result, null, '\t') } | |
: { | |
statusCode: 500, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import request from 'request-promise'; | |
import crypto from 'crypto'; | |
const { | |
API_GATEWAY_URL = '', | |
TWITTER_ACCESS_TOKEN = '', | |
TWITTER_ACCESS_TOKEN_SECRET = '', | |
TWITTER_CONSUMER_API_KEY = '', | |
TWITTER_CONSUMER_API_KEY_SECRET = '', | |
TWITTER_DEV_ENV = '', |