Forum des Objets Communicants et Solutions pour les Libérer...


 
AccueilAccueil  GalerieGalerie  FAQFAQ  RechercherRechercher  S'enregistrerS'enregistrer  Connexion  

Partagez | 
 

 Nabaztag as tactile *input* device

Voir le sujet précédent Voir le sujet suivant Aller en bas 
AuteurMessage
slackr
Lapin nain
Lapin nain


Localisation : Paris, France.
Nbr de messages : 1
Carottes : 4164

MessageSujet: Nabaztag as tactile *input* device   Dim 5 Mar 2006 - 18:13

My favourite part of the Nabaztag API is the fact that you can get the current position of your rabbit’s ears — whether they were turned to that position by you manually, or by a command from the nabaztag.com website.

Just use this URL:
http://www.nabaztag.com/vl/FR/api.jsp?sn=YOUR_SERIAL&token=YOUR_TOKEN&ears=ok

(Replacing YOUR_SERIAL and YOUR_TOKEN with your rabbit’s unique values.)

Then you should get html output like this (it’s in French if you set your Rabbit to speak French):

Here the position of the ears:
Left position = 14
Right position = 15

It’s easy to scrape those two values from the output in PHP using preg_match_all like this:

Code:

$subject = file_get_contents(”http://www.nabaztag.com/vl/FR/api.jsp?sn=YOUR_SERIAL&token=YOUR_TOKEN&ears=ok”);

preg_match_all(”/[0-9]+/”, $subject, $ears);

// Latest ear position reported by API
$posright = $ears[0][0];
$posleft = $ears[0][1];
Revenir en haut Aller en bas
Kayakbabe
Lapin nain
Lapin nain


Nbr de messages : 4
Carottes : 4013

MessageSujet: Re: Nabaztag as tactile *input* device   Ven 28 Juil 2006 - 5:51

This is exactly why I bought this rabbit.

I'm about a days away from having it integrated with my oscommerce store.

I can already turn the ears to certain positions in order to request information such as, number of sales in last hour, number of sales since midnight, number of sales this week, number of sales last month, I also am having it run a database checking script. I have a mysql table that keeps getting corrupted on another website I have.

This little bunny will give me some peace of mind in the evenings. I won't have to be at my pc all the time.

PHP is a wonderful coding language.

It's about done.

I'll share the script if you have your own oscommerce store.

I don't really want my store's private info out there for anyone, so I won't reveal the name or location of the actual script.

In fact, I think I"m going to put it on the oscommerce website as a contribution for oscommerce store owners.

Hey.. does Nabaztag have an affiliates program?

I think this could sell a lot of little bunnies! LOL.
Revenir en haut Aller en bas
Govan
Lapin nain
Lapin nain


Localisation : Scotland
Nbr de messages : 1
Carottes : 3854

MessageSujet: Re: Nabaztag as tactile *input* device   Jeu 4 Jan 2007 - 0:02

Could anyone out there shed any more light on using the ears as input?

As far as I can see from the API it's not possible to set up services with Violet in the form

"When ears are at X and Y, do this"

Does this mean that the only way to use the ears as input is to have another process (say a php script on another server) hit the api server every minute or so to check the ear position. This script can then do *whatever* and package up a message to send back via the rabbit when it reads that the ears are in the trigger position.

Is that correct or is there a more direct route?

Thanks,
G
Revenir en haut Aller en bas
Contenu sponsorisé




MessageSujet: Re: Nabaztag as tactile *input* device   

Revenir en haut Aller en bas
 
Nabaztag as tactile *input* device
Voir le sujet précédent Voir le sujet suivant Revenir en haut 
Page 1 sur 1
 Sujets similaires
-
» Nabaztag as tactile *input* device
» achat d'un Nabaztag V2
» UPDATE : Application radio pour votre Nabaztag
» Impossible de trouve le reseau nabaztag, le lapin est bleu
» probleme nabaztag + noos

Permission de ce forum:Vous ne pouvez pas répondre aux sujets dans ce forum
Forum des Objets Communicants et Solutions pour les Libérer... :: IV. I Don't Speak French! :: Archives :: API & Developments-
Sauter vers: