Posts Tagged ‘PHP’

NabRSS initial release (0.1)

Friday, July 13th, 2007

I have written an RSS to Nabaztag (using API) php scripts. Special thanks to magpierss, for doing the complicated work of converting RSS feeds to PHP-usable arrays.

This system requires MySQL server, Apache server and PHP version 5 (haven’t tested it on PHP version 4).

The scripts are supplied under GPL license, and are free for use and distribution. Please keep the header information containing my details on every distribution of the scripts. Also, please help me make the scripts better, by leaving feedback and sending me fixes.

You can find the archive here: nabrss-0.1.tar.gz

Enjoy!

More on the Nabaztag/tag

Wednesday, June 13th, 2007

Actually, this post has become less of the non-technical type and more of the technical type, however, for the sake of the cute little Nabaztag (you can send me messages too! Go here and send a message to “fatutchi”!), I keep it still in this category as well.

Today is a busy day, so I’ll have several posts.

This one will deal with the Nabaztag/tag. I have extended the PHP form/script offered in my previous post to allow for multiple Nabaztags selection. Also, added reading the ears status, and parsing the XML returned by the Nabaztag API site.

This is an ugly script, but it works. As said before – if you see fit to extend it or add features, please do so. Attached here: nabiV2.php.txt

I have noticed Violet had several issues with their site. I must confess that I have expected more from their site. As I’ve been involved as a consultant in several large-scale setups which sustained several tenth of thousands (and more) of connections per second, I know that, usually, the main performance hog is caused by an inefficient application design. It could be that Violet’s problems might just point at a low quality server-side software. Pity. I hope it will get better.

I have a Nabaztag/tag

Tuesday, June 12th, 2007

I have received my Nabaztag/tag just a day ago, and it is a cute little thingie.

At-ten-tion!

What can it do?

Actually, not much. It is a wireless device (client) which access Violet’s Nabaztag servers to get its commands. You, theoretically, cannot hijack the session and use it directly over LAN, but you must go through the Internet. This leads to delays in assigning commands.

It can move its ears (surprisingly, very quietly), it can play sound, either by text-to-voice (probably happens on the server-side) or streaming MP3 (cannot, as far as I’ve noticed, play MMS directly). It can also report its ears positions.

I can fly!

As you probably know, the more important thing is not about what it can do, but about how we can utilize it. Violet has added a list of RSS sources for the Nabaztag to read aloud. Through server-side sub processes, it can tell the time (usually at full hours), it can act as a wakeup clock (doesn’t do its job for me – not enough to wake me up), etc. It can probably take part in games based on the location of the ears (for example, if you agree, move the right ear down, etc).

You can check wikipedia for its entry. They cover most of it, maybe except for how cute it is, and it is.

If it were to end at this, I would have been quite frustrated, especially with the device’s price. However, Violet has exported an API which allows me (and you, and him, and everyone!) to send commands (unlimited by the number, as it seems) to the Nabaztag – Say this, move your ears to this position, etc. It allows me to send a choreography, aka a dance, to the device, and it will perform it based on the timing set by the sender.

I have wasted some of my day yesterday to write down a simple (and quite ugly, if you ask me) form which will use the API for simple commands. In my TODO list there is to implement the whole choreography thing, and make it easy. I would like to build this interface as a base for possible other utilizations, such as community games, etc.

I have uploaded my API using PHP form here which is free for use (of course) and everyone is encouraged to use it and/or modify it, as long as you give me my credits :-). I’m not sure about its security yet… nabi.php.txt

It’s a raw thing, but it works. Don’t forget to:

1. Activate your API interface in http://my.nabaztag.com

2. Change the parameters of your SN and your TOKEN

3. Place the script on PHP enabled site.

Enjoy!

Not much of a programmer

Thursday, August 11th, 2005

I’ve never been much of a coder. I used to write a little pieces of code in C, when I was student, but long since I’ve stopped.

I have had a resolution just now. To learn PHP and Perl. I want to build few things, and now is as good a time as ever.

I have the literature, I have the will, I only need enough of it, and some time.

Long while and not much to talk about

Saturday, August 6th, 2005

I’ve been to our own little “August Penguin” just few days ago, and it wasn’t too good. I avoided the lectures (who needs secure rsync?!?), but sat and talked with friends about all kinda stuff. One of the advantages of such an event is that you get to meet lots of your linux-related friends, and you get to talk technicalities with whoever you feel like doing it. It’s the place for it. You speak of funny geekish things you had, and people around you laugh. You tell your saddest stories (how the storage went berserk, for example), and people understand what you’re talking about. That’s the fun part. Other than that, it wasn’t that good. Wasn’t worth the long drive, and the day off (well, the day off was worth anyhow, for what it is).

I didn’t do much since. I’ve refused a job offer, as the salary was too low, and the driving was too long, and I will be interviewed for AIX clusters soon, which I don’t like anyhow…

Our client, the one with the hosting server, got hacked. It was a minor thing, and some defacement, but he detected it a day too late, and we could not dig it out of the logs. Not only, we found out the hacker run sendmail, on some arbitrary port, and we just removed it, and tried to locate the hole in though he got in. It’s something with PHP. It’s always something with PHP. I have no idea as to what, especially when there are around 400 hosted sites on this server. We’ll know better in the future, when it happens again.

A server of a friend of mine was highly loaded in the last few days. It appears Apache was killing his machine. His Apache is supposed, in 90% of the cases, to respond once, and close the connection. I’ve helped him, and removed the keepalive, and although it decreased the number of running servers dramatically, there were few instances of apache still consuming high CPU. Using extended server status, and top, I was able to notice the high load was due to some specific PHP script, which got to wait for 10 minutes, each time. I was able to point out at that script, and he checked it, and found a bug. Small PHP bugs get to increase load on servers dramatically. One should be aware of it. Anyone can write PHP scripts, but only some can write it with performance in mind. Mind you.