Giter Site home page Giter Site logo

facebook-bot-google-apps-script's Introduction

What is this?

This is an implementation of a Facebook Messenger bot written in Google Apps Script (a javascript runtime in the google cloud). The advantage of using Google Apps Script is it allows GET and POST requests to be made and recieved for free and without having to run your own server. It also allows arbitrary temporal triggers to be set so functions get be run at exact times or on minutely/hourly/daily/weekly intervals.

How to get started

  1. Go to http://script.google.com and copy the code in. Save and name the script and go to the cloud icon (5th icon from the left), change the bottom dropdown (“Who has access to the app”) to “Anyone, even anonymous”, and click “Publish”. Copy that URL for use in facebook
  2. Follow Facebook’s Getting Started tutorial and, when it asks for the callback function for the webhook, paste the previous url in
  3. After making any changes, the app needs to be update
    • Go to the cloud icon again, click the “Versions” dropdown and go the bottom for “New”, then click the “Update” button

Where should I make changes

The main place to make changes is around line 117 with the case statements, enter the keywords you want and change/write the functions you want that keyword to call (the left panel of this page has many good example templates, just copy what’s between the “message” key into the new function (More complicated use cases with callbacks and buttons is possible)

facebook-bot-google-apps-script's People

Contributors

jzl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  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.