https://www.npmjs.com/package/facebook-chat-api https://github.com/mrkno/Kassy https://github.com/mrkno/Kassy/blob/master/doc/integrations/Facebook.md
This worked, caveat update your node and npm and better yet (for me solved) just use Docker.
Using our existing search is difficult, it contains restrictions on what and how I search that presents difficulty in getting "open" results that I can filter on in my current client at present the facebook chat client.
Debugging the Kassy plugins is tough because the feedback is not clear when there are strange (not critical) errors in loading the plugin. It would be important to TDD these guys so that it's not mystery magic when debugging. Going to try the JSHint Node module http://jshint.com/install/ to see if it helps. JS Hint helped a bit, it found my missing semicolons however the module would still not load. Only adding console.log(e) to places in core/modules.js would actually surface the error when logging out the exception that was found on load.
Logic errors are difficult to find in the platform at the moment. Going to try this Node-Inspector https://github.com/node-inspector/node-inspector
Node-inspector looks neat but not at all what I need right now. What I need right now is this
node main.js debug facebook
# exactly the detail I look for and then I don't need to add the extra console.logs in Kassy's codebase.
I am realizing that returning even 3 results at once is too many results in a chat interface. Your friends wouldn't (normally) do that to you. You return one thing and then refine through a conversation.
Hmm reloading a plugin would be very worth it during iterative development. Again test harness and fast reloads are related topics. Right now restarting the server to see changes:(.
OOOH I realize that I don't have to bother with what is in the image for the record I return, because if I'm sending back a URL then FB messenger will generate the preview for me. Platforms! All of the extra noise needs to go away. Return one thing and return it well. This is chat, no time for nonsense.
Ah here's how the platform works, you return it URLS and it will be responsible for rendering them. That's why if you give it a bad URL you will get a {error: 'Invalid URL'} as a response from your integration platform. (Facebook in this case).
Ok use Bluebird for promises. To make the callback neater.
I like the idea of user accounts for this instead of a centralized business account because then we can have different groups of people interact with an account that they like. We would be growing differences and being more direct rather than trying to be one thing for everyone. That latter I don't think is a great goal. In using different accounts you can actually see the friendship circles coming into a great use. OH I used this bot and it did me well, here my friends, you should try them too. This would be our problem to solve and material to naturally learn from. The limitation of 5000 friends is then good for this.
ANNNND blocked by security through the chat interface.
-
Restrictions are opportunities. No Facebook Messenger SDK implied using a user account as the chat bot. That puts a limit on how many people this bot can chat with. However this opened ideas of custom personalities on bots.
-
Less is more. Started with returning top 3 results and for each printing out the title, the URL and the image. Was immediately annoyed with the number of message on my "small" screen. Result is that each response is exactly one url.
-
Platforms are great! Facebook's automatically fetches the URL provided in the message.
-
A simplified search API would help in fetching data in clients that need unstructured stuff that they will want to work with.
-
Don't attempt to develop in Node without dockerizing your application. Version versions versions. ##OH SO MUCH TODO
-
Add realistic headers in these requests to avoid being flagged as a spammer by Facebook. NOPE this is done here already.
-
The event that we receive contains the facebook user'd ID that we should use to know more about the person to see what to respond to them with. Like I need some music should try to take into account the tastes of the person.
{ thread_id: 732284938,
sender_id: '732284938',
sender_name: 'Dmitri Zabatay',
body: 'Jazz in New Orleans'
}
- Make a more flexible search API client.
- Save user queries for each user and our responses to them.
- Sign up and do the messenger for business.
- Promises
Definitely try the Hubot approach as it can then be reusable across platforms. https://www.npmjs.com/package/hubot-facebook - Clarissa "Explains It All" ^ This did not work as the chat bot did not receive any messages.
Lita is A Chatbot derived from Hubot but in Ruby https://docs.lita.io/getting-started/
Read the backstory http://techcrunch.com/2016/01/05/facebook-messenger-bots/
Conversation API to integrate for easy conversation support and maybe it comes with NLP 4 me https://api.ai/
List of Ruby tools for Natural Language Processing (and just word stuff) https://github.com/diasks2/ruby-nlp