Topic: PHP Clean Code

Guys,

My first post and i'm on the scrounge already wink

Our rabbit arrived yesterday and we have been playing with the API.

We have also been trying to convert some French script so we can provide the English market with a series of free tools.

Does anyone have a nice clean PHP input form/processor we can use to start the buildign of these service as it will be a lot quicker than translating the French stuff.

Thanks smile

Re: PHP Clean Code

Hey, Comsumerway, welcome to the cult, er, I mean group.

I need to create some links to the 4-5 PHP based web interfaces out there (that share their source code, of course). A quick search of Google came up with this one...

http://www.uk-dave.com/projects/misc/ph … oller.html

I also found a good set of PHP 5 OOP classes that I liked. I copied them to my server, but damn if I can't find the original author. It's linked somewhere off the Nabaztag.com site, so I'll go back looking for them.

Re: PHP Clean Code

Hey Roy,

Thanks for the feedback, we'd found that site before but beleive it uses APIv1 and not APIv2.

We played around with some script last night and got most stuff working. Going to look at the Choregraphy stuff later and try and make that slightly more user friendly.

We are slowly getting there and should have something to play with in the not to distant future.

Re: PHP Clean Code

Anyone interested in setting up a Sourceforge project ? Or even just rounding up the code.

I'll probably also code up a phpWebSite module for fun too and add that to https://sourceforge.net/projects/phpwebsite-comm/

phpWebSite is a content management system.

Re: PHP Clean Code

Anyone is more than welcome to help us with our coding and help create the ultimate alert system for the Nabaztag.

Re: PHP Clean Code

Looking forward to rolling up my own sleeves and doing some coding. I would not use the words "alert system" though. Nabaztag has the ability to communicate via audio, lamps, and ear positions. It also has the abilty to send information through the manipulation of the position of its ears.

I think that thinking in terms of "alert system" limits your creativity.

Re: PHP Clean Code

Hey Roy,

To start with all our custom codes will be some form of alert as we see these as more important than other features at the moment, but sure we'll work on the other things such as mp3 etc soon.

Re: PHP Clean Code

Nabaztag has the ability to communicate via audio, lamps, and ear positions. It also has the abilty to send information through the manipulation of the position of its ears.

I think that thinking in terms of "alert system" limits your creativity.

Unfortunately, a lot of the really creative options are somewhat limited by the current state of the API.
Please see my posts, "v3 API requests"

In summary, we can move ears and they stay where they are put - but you have to put up with an audio jingle each time.  This is distracting to say the least... sad
LEDs and sounds cannot be looped, so you have to be near the Nabaztag and pay attention to it when something happens in order to be informed of anything.  It would be far cooler if it could just sit quietly reporting on things via the LEDs.

/\dam

Re: PHP Clean Code

Hey Shiek,

Yeah, I agree that the device is only as good as its API. I guess I'm just trying to keep my own mindset focused on "What could I do with these types of inputs and outputs, assuming the sky is the limit for the API?".

In reference to your V3 API list, I wonder if the LEDs on the Nab are pulsed due to heat or power supply limitations? I would like the ability to have them on solid, but maybe there's a hardware limitation.

Re: PHP Clean Code

Guys,

We now have our code reading RSS feeds, this includes weather, news etc etc.

We will be showing it to you very soon, just cleaning it up a tad.

11

Re: PHP Clean Code

Hey Consumerway,

Is the idea to just provide a basic chunk of PHP code for people to use, or host somewhere, or what?

Here's the code I was thinking of previously, which is a good foundation for V2. Probably a little late for you to use though.

Re: PHP Clean Code

Two thoughts really not decided yet.

1) Provide php code as a download
2) Create a free members area and allow access to the features.

We like the idea of 2, sign up, add your serial etc and then each time you sign in you select what you want. We'd also be looking at a time scheduled system to allow you to specifiy what and when.

Any thoughts?

13

Re: PHP Clean Code

I've also been wanting to replicate and extend some of the various services that Nabaztag currently offers. I'm actually a certified by Zend PHP developer as well, so it will give me a chance to keep those skills polished (since my day job requires very little of it right now).

I agree that you should store your serial/API on the server, then you could use a cookie to maintain that information (or just the session management built into PHP) for those that don't mind this information being maintained.

Re: PHP Clean Code

Would you like to partner with us and maybe knowledge share and get a site up and running?

I run a web dev company so can arrange hosting, domains etc etc

15

Re: PHP Clean Code

Yep, we could probably work something out and share ideas, coding, etc. Why not just go ahead and get release 1.0 of your script out there and then we'll go from there? If it starts to get complicated, we can migrate to a SourceForge project or something a little more disciplined.

Again, I'm just hoping the Nabaztag folks won't be too cranky if we end up replicating some of their existing subscriber functionality. We're obviously forced to channel everything through their servers to then relay to the bunnies.

Re: PHP Clean Code

No worries Roy,

We'll have something ready in a day or two.

Having to go through thier servers is really bad especially with the recent downtime and time delays sad

17

Re: PHP Clean Code

Looking forward to seeing the code. I'll try to build my own, preliminary code and maybe we can join forces later on. You using some of the built-in XML parsing in PHP, or are you using regular expressions to get the necessary text out of RSS feeds?

Re: PHP Clean Code

We use an RSS to HTML convertor we have modified.

Re: PHP Clean Code

I wonder if the LEDs on the Nab are pulsed due to heat or power supply limitations? I would like the ability to have them on solid, but maybe there's a hardware limitation.

The real issue IMHO is not whether they are pulsing or always on, but how to get them to pulse throughout the day.
This facility is not available through the API, but is demonstrably already possible, because the official weather service uses it. We just need Violet to add it to the v3 API...

I doubt there is any hardware reason not to keep them permanently illuminated though. If you put the rabbit in server mode it already does this, and they are just LEDs after all.

/\dam

Re: PHP Clean Code

It would be a cool feature. I know its possible as ours is pusating blue all the time at the mo - trying to work out why and what subscription is doing it

Re: PHP Clean Code

/\dam wrote:

The real issue IMHO is not whether they are pulsing or always on, but how to get them to pulse throughout the day./\dam

This is weak  hmm but, if you're just checking your Bunny for life signs, have it practice Ta

Fear of Hopping
The intimate thoughts of a girl and her Nabaztag.

Re: PHP Clean Code

consumerway wrote:

It would be a cool feature. I know its possible as ours is pusating blue all the time at the mo - trying to work out why and what subscription is doing it

Pulsing light blue all the time is Air Quality.

Re: PHP Clean Code

Thanks Shaun, turned that off as it was annoying.

Re: PHP Clean Code

Thanks Becky, but my rabbit already gets plenty of exercise wink.

The reason why it would be cool to light the LEDs and keep them flashing all day is that then my rabbit can tell me things passively, without me having to be distracted by audio jingles or being present at the time the message comes through.

For example, if I wander into the room, I would be able to see at a glance things like (and these are just examples)
- whether my friends are online (LED 1)
- do I have any outstanding orders on a website I run? (LED 2)
- tomorrow's weather forecast (LED 3)
etc etc.

All of these things are possible to see using a computer, but my computer isn't always on, and besides, isn't it nicer to be told such information by a cute little bunny? wink

There are plenty of other cool things we could code for this rabbit, we just need access to the LEDs!

/\dam

Re: PHP Clean Code

sheik wrote:

For example, if I wander into the room, I would be able to see at a glance things like (and these are just examples)
- whether my friends are online (LED 1)
- do I have any outstanding orders on a website I run? (LED 2)
- tomorrow's weather forecast (LED 3)
etc etc.

All of these things are possible to see using a computer, but my computer isn't always on, and besides, isn't it nicer to be told such information by a cute little bunny? wink

Yeah, I trust that stuff more coming from a bunny.

Fear of Hopping
The intimate thoughts of a girl and her Nabaztag.