PHP Finger Client Linux Kernel

Bookmark on del.icio.us

This example shows how to create a simple finger client with php. The script connects to kernel.org to fetch the latest linux kernel information. Here a simple unordered list is created to display the contents.


<ul>
<?php

/*** connect to port 79 ***/
$fp = fsockopen('kernel.org', 79);

/*** get the info ***/
while( !feof($fp) )
{
/*** get the text ***/
$text = fgets($fp, 128);
/*** make sure we have a valid line ***/
if(trim($text) != '')
{
/*** add to the list ***/
echo '<li>'. trim($text).'</li>';
}
}
/*** close the file pointer ***/
fclose($fp);
?>
</ul>

Demonstration

  • The latest linux-next version of the Linux kernel is: next-20100113
  • The latest mainline 2.6 version of the Linux kernel is: 2.6.33-rc4
  • The latest snapshot 2.6 version of the Linux kernel is: 2.6.33-rc3-git5
  • The latest stable 2.6.32 version of the Linux kernel is: 2.6.32.3
  • The latest stable 2.6.31 version of the Linux kernel is: 2.6.31.11
  • The latest stable 2.6.30 version of the Linux kernel is: 2.6.30.10
  • The latest stable 2.6.27 version of the Linux kernel is: 2.6.27.43
  • The latest stable 2.4.37 version of the Linux kernel is: 2.4.37.7
  1. No comments yet.

  1. No trackbacks yet.