<?php
/*
Plugin Name: Blogring.hu pinger
Plugin URI: http://silver.balaton.to/wp-content/blogring.hu_pinger.bz2
Description: This page pings a hungarian bolgring site.
DONT FORGET to setting up your blogring id!!!
Author: Silver <silver@balaton.to>, Gabor <gabor@20y.hu>
Version: 0.2
Author URI: http://silver.balaton.to/
*/ 

// YOU MUST SET THIS VARIABLE!!!!
// KI KELL TÖLTENED EZT!!!!
// A blogring.hu-n bejelentkezésed után a blogadatok gombra
// kattintva a megjelenõ lap közepe táján megjelenõ
// "Frissítettem a blogom!" gomb-hoz tartozó URL-t másold ide.
// Ez feltehetõleg valami ilyesmi lesz:
// http://blogring.hu/Touch.aspx?blog=silver&pwd=zagyvaságok
// Ha a fentieket szebben is el lehet mondani, kuldd el a
// szoveget, hogy bemásolhassam :)

$pingerurl 'http://blogring.hu/Touch.aspx?blog=20y&pwd=1ff3480bdbf84745a6f569599e1a8f34';

// rest of the code, you don't need to modify it.
// (except if you want error checking)

$port 80;

function 
blogringping()
{
    global 
$pingerurl$port;
    list(
$host$dir) = explode('/'str_replace('http://'''$pingerurl));
    
$header "GET /$dir HTTP/1.1\r\n" .
              
"Host: $host\r\n" .
              
"User-Agent: Mozilla/5.0 (X11; U; Linux i686; hu-HU; rv:1.7.12) Gecko/20050922 Firefox/1.0.7 (Ubuntu package 1.0.7)\r\n" .
                 
"Connection: Close\r\n\r\n";
    
$socket fsockopen($host$port);
    if (
$socket) {
           
fputs($socket$header);
    }
    
// If something goes wrong, uncomment these lines to see the output
    // while (!feof($socket)) {
    //    $buffer .= fgets($socket, 128);
    // }
    
fclose($socket);
}

add_action('publish_post''blogringping');

?>