通过 cron(或不)根据远程请求将浏览器刷新到不同页面?

发布于 2024-08-02 15:43:01 字数 613 浏览 4 评论 0原文

我需要以教程方式显示页面。我查看了 netsupport、beamyourscreen 和其他可能性,但我不希望观众下载任何内容。由于某些页面中嵌入了音频/视频说明,我无法使用 gd / 发送屏幕截图。

基本上,我需要能够通过我端的界面将用户浏览器窗口“刷新”到不同的页面。无论是通过表单提交、JavaScript 还是任何其他类型的“控制器”,都允许我更改查看者浏览器上的页面。 PERL 是首选,但是 PHP / javascript 可以工作并且是跨浏览器的。我设置了一个简单的 javascript 页面转发计时器,它“有效”,但是页面加载时间和对话中断是一个重要因素。

整个教程网站都会围绕这个能力来开发。

我正在寻找curl / cron / wget 方法,但是发现的信息很少。

我见过论坛和聊天脚本基本上执行类似的任务,但是,在 leau 中必须有一个简单的解决方案来破解另一个脚本以满足我的需要。

我也不希望其他人控制页面。该网站实际上只需要在教程期间可访问,但是,只要用户交互正常,除非(受到控制),它“可以”保持网络可访问。

最初的网站概念是指导人们如何正确地将新宠物引入家中。将由拯救我宠物生命的退伍军人操作。我想回馈一些东西。

可能的?我真的很欣赏简单的例子等等......

I need to display pages in a tutorial fashion. I looked in to netsupport, beamyourscreen and other possibilities but, I do not want the viewers to download anything. I cannot use gd / send screenshots due to audio / video instructions embedded in some of the pages.

Basically, I need the ability to "refresh" a users browser window to a different page via an interface on my end. Whether via a form submission, javascript or any other type of "controller" that allows me to change the page on the viewers browser. PERL preferred but, PHP / javascript whatever works and is cross browser. I set up a simple javascript page forward timer that "works" but, page load times and conversation interruptions are a huge factor.

The entire tutorial website will be developed around this ability.

I was looking in to curl / cron / wget methods but, found little information.

I have seen forum and chat scripts that basically perform a similar task but, there must be a simple(ish) solution in leau of hacking up another script to suit my needs.

I do not want others to control the pages either. The site really, only needs to be accessable during the tutorial however, It "could" remain web accessable as long as user interaction was normal unless (being controlled).

The initial site concept is based on instructing people how to properly introduce new pets into a home. Will be operated by a veteranarian that saved my pets life. I wanted to give something back.

Possible? I really appreciate simple examples etc...

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

风月客 2024-08-09 15:43:01

你没有其他办法,只能使用 javascript 不断轮询服务器以获取“指令”。不,您不能向最终用户浏览器发送任何内容,无论是curl还是wget。

主要是,您必须在浏览器和服务器之间设置一个简单的请求/响应协议。

如果你想更深入,你可以使用 cometd/meteord/etc 之类的东西。如果没有,一个隐藏的 iframe 可以重新加载自己并接收带有 javascript 代码的页面来执行所需的操作。

You have no other way but to keep polling the server for "instructions" using javascript. No, you can't send nothing to the end user browser, neither curl nor wget.

Mainly, you'll have to set up a simple request/response protocol between the browser and the server.

If you want to go deeper, you can use something like cometd/meteord/etc. If not, a hidden iframe that reloads himself and receives pages with javascript code for the needed actions can do the trick.

2024-08-09 15:43:01

另一种选择。

使用 javascript dopolling 和单字符平面文件。有一个带有单个变量的简单单字符平面文件。用 perl 编写(它比 php 更快并且使用更少的资源)。父脚本调用平面文件中的 javascript 变量。它到达平面文件并到达 var 设置的地方。平面文件由控制器写入。完毕。

我想您也可以重命名一个空平面文件并将其用作控制器。我知道哪个更快,打开并读取特定文件或点击目录并返回文件名。在控制器端,打开和写入文件与重命名文件。也许他们在资源和时间上互相对抗?

这样该站点就可以充当普通站点。当您想让远程用户看到“演示文稿”(按照控制器的速度自动显示站点页面)时,控制器会激活轮询并告诉查看者按下开始按钮。这使得远程讲师可以在闲暇时为观众加载页面。

这是一个简单的解决方案,不需要任何复杂的操作。也不需要框架。只需要启用 JavaScript 即可。

有更好的建议欢迎提出!

Another alternative.

With javascript dopolling and single character flatfile. Have a simple one character flatfile with a single var. Write it in perl (it is faster and uses less resources than php). The parent script calls a javascript variable in a flatfile. It hits the flatfile and goes wherever the var sets it. The flatfile is written to by the controller. Done.

I guess you could also rename an empty flatfile and use that as the controller. I am usure which is faster, open and read a specific file or hit the directory and return the file name. On the controller side, opening and writing to a file vs renaming a file. Maybe they counter each other in resources and time?

This way the site can act as a normal site. When you want to have remote users see a "presentation" (automatically being shown the site pages at the controllers pace), the controller activates polling and tells the viewers to push a start button. This allows a remote instructor to load pages for the viewers at his leisure.

It is a simple solution that works with nothing really sophisticated going on. No frames are needed either. Just need javascript enabled.

Any better suggestions are welcome!

谈下烟灰 2024-08-09 15:43:01

我想到您可能想要使用的是 HTML Push 技术。查看维基百科,他们有几个链接。我自己没用过

It occurred to me that what you might want to use is HTML Push technology. Check out the wiki, they have several links. I have never used it myself

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文