isVHSopen is getting an upgrade!

Also, I’m working on a new API service.

I am not sure, you would need to read the code.

Okay, well I haven’t seen anything in the code that allows for deletion using the http GET api, so the answer’s probably no, without reaching into the backend.

Checked the code, and it turns out it’s doing a very aggressive sanitization. Both the dataname and the value are limited to letters, numbers, and the characters _/-

my $sanitize_rx = qr/[^A-Za-z0-9_\-]/;
$dataname =~ s/$sanitize_rx//g;
$value    =~ s/$sanitize_rx//g;

Should we change this? If we change it on GitHub, how difficult will it be to update the server with the new code?

@TyIsI, want to provide any info on your new API service?

It’ll be similar, but with a different backend (Node)

Maybe I missed it, or it’s in another thread, but how do people set the closing time?

It’s not up yet; we’re still using the basic lightswitch. I’ll probably bring it down to the space tomorrow. It’s a box with a keypad and a clock display for the current and closing times, so it’ll be pretty straightforward once you see it.

Yes I will, I’ll be at VHS later tonight so maybe we can do it then. Will that allow me to post it as a VHS project instead of a personal project? I’m also wondering if this should be included as part of Bruce’s SpaceTime GitHub project, or if it should be a different one.

Also, a couple API requests I have for your new are:

  • Allow for more characters, at least for stored values. But of course, preventing XSS is paramount.
  • Provide an “Update if changed” command, the difference being that it will not update the Timestamp if the value doesn’t change, whereas a straight “Update” command will update the Timestamp every time the call is made.

The box is up and in the space, just above the Frankenstein-style “knife switch,” powered on and usable! The only catch right now is that we still need to update the page displayed at isvhsopen.com. So for now, feel free to play with it, but continue to use the lightswitch to control isvhsopen. Right now, SpaceTime is configured to update variables key and test1 online; door is what is used for isvhsopen.

As for the new web UI, here are two possible options:

I prefer the latter (13:45), but let me know which you like, or if you have any other ideas.

If we wanted to keep it all within the Dancer codebase, we could add a template similar to data-full.tt, and then add a new query type to the VHSAPI.pm. Of course it’s all pretty simple, so there are many ways it could be accomplished.

5 Likes

So I don’t know what the best way is to go about updating the isvhsopen.com website, but this is a way and I think it’ll be just fine. I’ve made updates to the VHS API codebase and submitted a Pull Request for others to look over.

The changes are quite simple, and should be straightforward for any enterprising individual with proper access rights (@TyIsI) to push onto the http://api.vanhack.ca server. The biggest change involves adding a new template so that isvhsopen.com will look like the second screenshot in the post above.

Less important, but perhaps more interesting, I’ve also submitted a Pull Request for the SpaceTime Python code.

3 Likes

Bumping this thread.

Seems like we are close to getting the “Open Until” bit working. Is there something I can do? @TyIsI

Mark

I think the next thing to do is to get the new VHS API deployed to the Talk server. Once that’s done, we’ll have to update the DNS entries for isvhsopen.com and then test that it all works.

1 Like

Sorry guys, I’m ridiculously behind on stuff.

No worries, personal things are always first priority. Do we know if there is anyone else who has access to do it?

As someone that is hanging off the isvhsopen page lately, occasionally refreshing it to ensure I have current data… (but recognizing that it could be set to refresh itself, or maybe already does, not sure)…

It would be cool if it played a sound on any desktop that had it open as the space switched from closed to open, or vice versa… that way I could have the page open in another tab and it would play a little bugel noise of something that represented when the hackspace was opened up.

Obviously, applying for keyholder status, which I should do anyways, would solve this for me… but I just think it would be a cool feature for those that don’t have the ability to get in there whenever they want (which is what I’m suffering through currently).

Here’s an awesome suggestion for the noise… :wink:EFX EXT Civil War Bugle 16 B | Soundsnap

Obviously not hugely important, and I don’t have the requisite skills to make it happen, but just a suggestion that I think would make the page more awesome.

1 Like

You should check out this awesome project!

Yeah, I considered making a Chrome extension that shows different indicator icons based on the state of isvhsopen.com. Sort of like an IFTTT Chrome extension. I’m sure it’d be easy, but it seemed like such an obvious problem (website polling + regex-based query = notification) yet I couldn’t find an existing one (or even reasonable search terms for it) so I never got around to doing it. After all, if I don’t know what to call it, how is someone else supposed to find it?

And you are correct that isvhsopen.com does not currently auto-refresh.

I like the option where “until xx:yy” is the same width as “open”.

Bump

@TyIsI.

I noticed you mentioned that you had some time in another post. Can you please deploy the updated API.

No I did not?

oops. Sorry. I misread your other post.

Seems like you’re on it anyways!

Thanks

Mark