Git Product home page Git Product logo

blank-lambda-bot's Introduction

#Blank AWS Lambda Bot

##Instructions There's a more detailed writeup here.

Prerequisites: I assume you have node and npm installed. Need help installing either? Here's a link for you.

  1. Clone this repo
  2. Run npm install
  3. Open in your favorite editor.

##Configuration

To run this bot yourself you will need Twitter and AWS credentials.

#####For Twitter, you will need:

  • a Twitter account
  • a Twitter application (not the same as a Twitter account; apply for one at apps.twitter.com)
  • a Consumer Key, a Consumer Secret, an Access Token, and your Access Token Secret

Put this information in the temp-config.js file, and rename it to config.js.

######For AWS, you will need:

  • an AWS account (you'll need to know your AWS account number)
  • a new AWS user for this bot (and its Access Key ID and the Secret Access Key)
  • the AWS CLI installed
  • a local profile configured to use your new user's credentials

Attach the AWSLambdaFullAccess Policy to your new user. Need help setting up an AWS account or user?

######Configuring for Lambda

Open the temp-lambda-config.js file and update the 'profile', 'role', 'region', and 'function name' fields. Rename this file to lambda-config.js.

If you change the name of the index.js file, you'll need to update it in both the lambda-config.js file and the gulpfile.

######Tests There are tests for the functions in index.js in the tests/test.js file. Run them with npm test.

##Source Data

To add text for your bot to tweet, add it in the botfiles/sample-text.js directory.

IMPORTANT: you must install the botfiles folder as a local module before deploying:

npm install --save ./YOURPATH/botfiles

If you make changes, you must update the installation:

rm -rf node_module/botfiles && npm install /YOURPATH/botfiles

##Deploy

To deploy, run the tests (and also gulp lint). When you're happy with that output, run gulp deploy.

##Lambda Your function will now be available in the Lambda console! You can configure a test event there (use '{}') and try it out!

You can also set up your bot to run on a schedule using the "Event Sources" tab in the Lambda function console.

##Thank Yous Thanks to Darius Kazemi for the wordfilter module and for the .pick function. Thanks to Thoughtworks for the wonderful node-aws-lambda module. Thanks also to Allison Parrish and David Celis for reviewing; all errors remain the exclusive property & reponsibility of the author. :-)

blank-lambda-bot's People

Contributors

emckean avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.