GithubHelp home page GithubHelp logo

georgeaiyudu / nodenewsbot Goto Github PK

View Code? Open in Web Editor NEW

This project forked from alyssaong1/nodenewsbot

0.0 2.0 0.0 6 KB

A NodeJS news bot for Facebook Messenger, built with Microsoft Bot Framework

Home Page: https://www.messenger.com/t/1363604437002370

JavaScript 100.00%

nodenewsbot's Introduction

NodeJS News Bot for Facebook Messenger

There's not too many practical examples out there of Nodejs bots built using Microsoft Bot Framework, so here's one. I've tried to leave comments to explain what's going on.

I will be posting a full tutorial on how to build this from scratch for beginners along with explanations, so look out for updates (or you can follow my Twitter).

Feel free to leave feedback. I also take requests for bots! You can tweet me or email me at [email protected] :)

Usage

Running it locally:

Go and get a Bing Web Search API Subscription Key from here and set BINGNEWSKEY in the code with your own subscription key.

Install and open up Bot Framework Emulator. In the fields at the top, your local port should be 9000, emulator url should be http://localhost:9000/ and bot url should be http://localhost:3978/api/messages.

Navigate to the folder with the bot in the command line. Run npm install to install the required node modules, then run node app.js to run the bot. You can now start chatting with the bot through the emulator.

Running it using Messenger:

Go and get a Bing Web Search API Subscription Key from here and set BINGNEWSKEY in the code with your own subscription key.

You will need to create a bot on Microsoft Bot Framework and replace the appId and appPassword in the code with your bot's appId and appPassword. You'll then need to add the Facebook Messenger channel and follow the instructions to configure your bot for Messenger (it includes making a Facebook page, etc). When configuring your bot for Messenger channel, you'll need to provide an endpoint for your bot when setting up the webhook in the Facebook developer portal. You can either publish the bot on a web host of your choice (e.g. Azure or Heroku), or use ngrok. Your webhook url in the Facebook developer portal can then be set to the /api/messages endpoint of your website or ngrok url. If you use ngrok, run ngrok http -host-header=rewrite 9000 in the command prompt and then set up the webhook in Facebook.

I'll be posting a more detailed tutorial of this in future.

Future Extensions

I'll be implementing the following features at some point in the future:

  • Using LUIS, Microsoft's NLP processing engine for advanced dialogs
  • Daily notifications

Contributing

Feel free to contribute to this project! Use the following guidelines:

  1. Fork the repo on GitHub
  2. Clone the project to your own machine
  3. Commit changes to your own branch
  4. Push your work back up to your fork
  5. Submit a Pull request online so that I can review your change

nodenewsbot's People

Contributors

alyssaong1 avatar

Watchers

James Cloos 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.