Forum des Objets Communicants et Solutions pour les Libérer...
Vous souhaitez réagir à ce message ? Créez un compte en quelques clics ou connectez-vous pour continuer.

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


 
AccueilAccueil  GalerieGalerie  RechercherRechercher  Dernières imagesDernières images  S'enregistrerS'enregistrer  Connexion  
Le Deal du moment : -14%
Apple MacBook Air (2020) 13,3″ Puce Apple M1 ...
Voir le deal
799 €

 

 Nabaztag as tactile *input* device

Aller en bas 
3 participants
AuteurMessage
slackr
Lapin nain
Lapin nain



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

Nabaztag as tactile *input* device Empty
MessageSujet: Nabaztag as tactile *input* device   Nabaztag as tactile *input* device Icon_minitimeDim 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 : 6505

Nabaztag as tactile *input* device Empty
MessageSujet: Re: Nabaztag as tactile *input* device   Nabaztag as tactile *input* device Icon_minitimeVen 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 : 6346

Nabaztag as tactile *input* device Empty
MessageSujet: Re: Nabaztag as tactile *input* device   Nabaztag as tactile *input* device Icon_minitimeJeu 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é





Nabaztag as tactile *input* device Empty
MessageSujet: Re: Nabaztag as tactile *input* device   Nabaztag as tactile *input* device Icon_minitime

Revenir en haut Aller en bas
 
Nabaztag as tactile *input* device
Revenir en haut 
Page 1 sur 1
 Sujets similaires
-
» Impossible de s'enregistrer sur http://www.nabaztag.com ? + Nabaztag V2 compatible ?
» Nabaztag orphanage opens / L'orphelinat de Nabaztag s'ouvre
» [Idée à approfondir] Serveur privé Nabaztag (Mon-Nabaztag.fr)
» Passer du Nabaztag au Nabaztag-tag : nouvel abonnement ?
» Changements dans l'API Nabaztag // Changes in Nabaztag API

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: