如何自动启动服务器端应用程序?
我想开发一个有时会自行发送消息的聊天机器人。这意味着它必须自己变得活跃。我该怎么做?
I want to develop a chatbot that sometimes sends messages on its own. That means it have to become active by itself. How can I do this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
最好的方法是创建一个独立的应用程序(使用您选择的任何语言),然后创建一个 crontab / windows 调度程序条目来运行该应用程序。该应用程序不需要在浏览器中运行即可连接到基于 Web 的应用程序。
Your best method is to create a standalone application (in whatever language you choose) then create a crontab / windows scheduler entry to run the application. The application doesnt need to run in a browser to connect to a web based application.
您实际上并不需要服务器。也许您可以利用您的 JavaScript 经验来编写浏览器扩展(例如 Chrome:http: //code.google.com/chrome/extensions/index.html)。浏览器扩展程序将可以直接访问您浏览器中的 Facebook 页面,并且通过这种方式与 Facebook 服务器进行通信将使您的生活变得更加轻松。
You don't really need a server for this. Maybe you could use you experience with JavaScript to write a browser extension (for example for Chrome: http://code.google.com/chrome/extensions/index.html). A browser extension will have direct access to the Facebook page in your browser and it will make your life much easier to communicate this way with the Facebook server.