Skip to content

WeijianL1/COMP523-Mr-Reese

Repository files navigation

Before you begin

Please install the following tools you need. For linux/mac os x users, it is recommended to install them by the package manager of your linux system. For windows users, you can link to following sites and install them by instruction.

Facebook messenger API setup

  • Create Facebook fan page and application
  • Create an messenger app on facebook for developers website.
  • Click 'Add Product' -> 'Messenger'. fb_1
  • Generate fan page Token
    • replicate the .env.example and rename it to .env
    • Choose your fanpage at Select a Page, and copy the page access token. Edit the .env and replace the FB_TOKEN token.fb_2

Create the services

  1. In Bluemix, create a Conversation Service instance.

  2. In Bluemix, create a Discovery Service instance.

  3. In Bluemix, create a Natural Language Understanding instance

  4. In Bluemix, create a ClearDB Managed MySQL instance

  5. In Bluemix, create a Weather Company Data instance

Set Up Conversation

  • Creat a Workspace
    • ​click on the upload button and choose the conversation_workSpace.json in Data folder
    • coversation_1

Set Up Discovery

  • Click on "Launch Tool"
  • Create two new collections (one for spreadsheet and another for news feed)
    • First click on "create a data collection"
    • Type you collection name
    • And then click on "Create"
    • discovery_1
  • Click into the spreadsheet collection
  • Load data into this collection by clicking "Upload Documents"
  • discovery_2

Deploy the server code to Bluemix

  • Fill out the .env file.

    • Conversation:coversation_2

    • Discovery: (for both collections)discovery_3

    • Weather: weather

    • NLP: nlp

    • MySQL: db_1

      db_2

  • install cli command

  • In your terminal under the root directory of app.js:

    cf login -a https://api.ng.bluemix.net
    
  • Type in your IBM username and keywords

  • Adjust manifest.yml

  • In terminal:

    cf push
    

Connect webhook with Bluemix

  • Once the broker app is successfully executed in the cloud, go back to the Facebook developer page to set up the webhook.
  • Callback URL: fill in the broker url (eg. https://yourname-broker.mybluemix.net/webhook)
  • Verification Token: Any non-empty string
    • Subscription Field:
    • message_deliveries
    • message_reads
    • messages
    • messaging_optins
    • message_postbacks should be checked
  • Select a page to subscribe your webhook to the page events

Reference

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published