Controlling Hype site with another Hype site?

Hi,

I’m looking at what is and is not possible with Hype and one of the possibilities we’re after is being able to trigger timelines / script / etc of a Hype project via another Hype project. Basically if a page is viewed live by audience, we can trigger a quiz etc remotely… These two projects could reside on the same server if required.

Is this possible with Hype or maybe someone knows of an external library that would do the trick? Would we need to create some sort of API in the viewer to plug into?

Edit: @MaxZieb - your GlobalBehavior looks interesting, in the example here, would it be possible to somehow only show the ‘controller’ widget to a specific user / via secret URL?

Thanks

Yes, there is a demo here… using Pusher.

Just open this link in the browser and maybe on your phone…
http://dev.maxziebell.de/Hype/GlobalBehavior/PusherTest.html
(This demo loads same test Hype export, but it could also be two Hype exports)

Thanks, looks great. How would you rate this solution in terms of reliability? I’m thinking hundreds of people viewing a page while we control their ‘widgets’ and any error/inconsistency would not please our client…

Shouldn’t be a problem… the service used is pretty big

I would roll a new or at least update the PHP-bundle (vendor.zip). It hasn’t been updated in a long time. See https://github.com/pusher/pusher-http-php and a description on the post I linked above…

Excellent, thank you. I’ll dig deeper. :+1:

Hi again @MaxZieb, I’m struggling a little with the Pusher implementation. Any chance you could share the Hype project for the page at http://dev.maxziebell.de/Hype/GlobalBehavior/PusherTest.html ?
I built a new PHP-bundle and updated the pusher api to 5.0 (<script src="https://js.pusher.com/5.0/pusher.min.js"></script>), not sure if these messed things up?

I’ve got the page subscribing to my channel but can’t seem to send events… the console logs shows the function returning the whole PusherTrigger.php:

Also, in the Pusher debug console it shows the page connecting and then disconnecting immediately; is this normal? See below:

Edit: Here is the new PHP-bundle vendor.zip (2.0 MB)

I am on the road. So have you tried it with the old vendor bundle just to make sure that the new bundle isn’t the problem…

#HelpForSelfHelp

Yeah tried that, no help. Just returning the php, which is weird?

Sorry, meant the Hype project for http://dev.maxziebell.de/Hype/GlobalBehavior/PusherTest.html

There seems to be some weird PHP issues, just debugging, will report back soon.

Right, all working now.

For some reason chrome didn’t like the PusherTrigger.php file you linked here: Hype GlobalBehavior (Custom Behavior Extension)

Had to tweak it so that it included <?php and ?>

That is true. Some server are configured that way. Sorry for the inconvenience. I added your vendor build as a link and your findings to the post. Anyways it was more of an Technology Demo rather then a full fledged extension to custom behavior (talking about the pusher test). Share what you got if possible. I am curious on what you are building with it.

No worries, massive thanks for the help!