Live data from Hacker News

Show HN: Turned Facebook Messenger into a JavaScript REPL

github.com

31–39 of 39 posts

Re: Show HN: Turned Facebook Messenger into a JavaScript REPL

#31

Is sending and receiving messages through facebook messenger still limited to the official app or did they add back an API to replace the old XMPP interface?

Facebook launched an API for this at F8 this year https://developers.facebook.com/docs/messenger-platform

I think that is different from what he is asking. I believe MaddoScientisto was talking about and API that could be used to create unofficial clients. The API you provided appears to be designed to create bots, and insufficient for custom clients.

Re: Show HN: Turned Facebook Messenger into a JavaScript REPL

#33

Hilarious! Now all I need is a bot that reads my messenger feed and executes commands. Never having to leave Facebook. 0_o

I thought you were going to say responds for you so you never have to get on Facebook.

In al seriousness, I don't really use Facebook for anything and only keep an account to communicate with my daughter's teachers. But as ASIMUV grows people are always asking about it on Facebook. Now I'm planning on using it as part of the community outreach program. And I'm not even sure how it works anymore... D:

Re: Show HN: Turned Facebook Messenger into a JavaScript REPL

#35
post #20
post #10

Or you could just open the developer console ...

Where's the JavaScript REPL on iPhone Safari?

You can create a bookmark, save it, and edit it to a "javascript:" link which mobile Safari will execute.

If you normally try to type JavaScript in the address bar, Safari will say, "JavaScript is not allowed to be used this way."

Re: Show HN: Turned Facebook Messenger into a JavaScript REPL

#36
post #30

Earlier quoted context omitted.

pain is information

Sure no yeah, all of the things you talked about in the talk are valuable things to know. You didn't talk at all about why they are that way, nor did you admit that you don't know (and neither do the language creators know) why those problems exist. Nor did you disclose that the most important thing to know was that these are undefined corner cases, of which technology is full of. Now there are millions of retweets o…

I will now justify some jokes that I made four years ago.

Most of my work that you've praised so highly concerns improving software quality and the experience of programming. Wat is about one of the underlying causes of low software quality and unpleasant experiences of programming.

Specifically, none of that JavaScript behavior is undefined. Brendan Eich specifically chose to define all of those conversions in those ways. JavaScript was designed to do what the programmer doesn't want (silently perform nonsensical conversions) rather than what they do want (throw an error). There are reasons for this, but in its current use context that decision is not what we want. Many people watch Wat and go on to learn all of this; there are dozens of blog posts, Stack Overflow questions, etc. where the behavior in Wat is dissected in detail. For example: http://stackoverflow.com/questions/9032856/what-is-the-expla... or http://blog.caplin.com/2012/01/27/the-why-of-wat/

Many programmers think that their tools work reliably; that they don't encounter problems often; that popular programming systems are fundamentally reasonable; that mistakes are always the programmer's fault. These people are wrong, to everyone's detriment. The easiest remedy is to show them, rather than tell them. Many people -- far too many now to count -- have said that Wat made them begin to realize how broken our tools are. That's a prerequisite to engaging with my (and others') longer-form work on improving things.

I could do a talk explaining all of this with examples and so on, but it would be full-length, not a lightning talk. My full-length talks get maybe 100k views, so the audience would be 5% of Wat's 2m views. Wat must be short, and therefore context-free, to work.

Re: Show HN: Turned Facebook Messenger into a JavaScript REPL

#37
post #30

Earlier quoted context omitted.

Sure no yeah, all of the things you talked about in the talk are valuable things to know. You didn't talk at all about why they are that way, nor did you admit that you don't know (and neither do the language creators know) why those problems exist. Nor did you disclose that the most important thing to know was that these are undefined corner cases, of which technology is full of. Now there are millions of retweets o…

I will now justify some jokes that I made four years ago. Most of my work that you've praised so highly concerns improving software quality and the experience of programming. Wat is about one of the underlying causes of low software quality and unpleasant experiences of programming. Specifically, none of that JavaScript behavior is undefined. Brendan Eich specifically chose to define all of those conversions in those…

[deleted]

Re: Show HN: Turned Facebook Messenger into a JavaScript REPL

#38
Messenger Platform docs happen to showcase very specific acceptable examples of what bots are expected to do[0]. An app like this doesn’t look likely to be approved to be publicly accessible.

Does anyone have experience getting FB’s approval for a Messenger bot?

[0] https://developers.facebook.com/docs/messenger-platform/app-...

Re: Show HN: Turned Facebook Messenger into a JavaScript REPL

#39
post #26

Do you have a link to the bot running in Messenger? The https://www.facebook.com/gdY7MU/messages/ link in the repo appears to be broken.

Hey, yes, sorry, I had misunderstood the Facebook Messenger bot review process. Thought that it was enough to publish the Facebook page in order to be able to receive and send messages to external people. Now the page can receive messages but those messages never make it to the server where the bot is located, and hence no response ever makes it back to you.. :(

Good news is that if you follow Facebook's guide to create a Messenger bot you can easily deploy this code and play around with it yourself. It works great to receive and send messages but only for the owner of the page/bot :)

I'll update you if I get the required permission from Facebook and the bot becomes publicly accessible.

Post reply on HN