Let server run without Twit credentials

main
Mike Fix 7 years ago
parent a4f90c30f0
commit c35ceb64ba

@ -4,13 +4,18 @@ const morph = require('morphmorph')
const RATE_LIMIT_CODE = 420 const RATE_LIMIT_CODE = 420
const MAX_ALT_TEXT_LENGTH = 420 const MAX_ALT_TEXT_LENGTH = 420
const client = new Twitter({ let client
consumer_key: process.env.TWITTER_CONSUMER_KEY, try {
consumer_secret: process.env.TWITTER_CONSUMER_SECRET, client = new Twitter({
access_token: process.env.TWITTER_ACCESS_TOKEN_KEY, consumer_key: process.env.TWITTER_CONSUMER_KEY,
access_token_secret: process.env.TWITTER_ACCESS_TOKEN_SECRET consumer_secret: process.env.TWITTER_CONSUMER_SECRET,
}) access_token: process.env.TWITTER_ACCESS_TOKEN_KEY,
access_token_secret: process.env.TWITTER_ACCESS_TOKEN_SECRET
})
} catch (e) {
// eslint-disable-next-line
console.warn(e.message);
}
const extractMediaId = morph.get('data.media_id_string') const extractMediaId = morph.get('data.media_id_string')
const extractImageUrl = morph.get('data.entities.media.0.display_url') const extractImageUrl = morph.get('data.entities.media.0.display_url')
const extractErrorCode = morph.get('0.code') const extractErrorCode = morph.get('0.code')

Loading…
Cancel
Save