Please login or register.

Login with username, password and session length
Advanced search  

News:

You need/want an older version of sNews ? Download an older/unsupported version here.

Author Topic: [MOD] Simple sNews "PINGer"  (Read 2218 times)

invarbrass

  • Full Member
  • ***
  • Karma: 18
  • Posts: 117
    • http://snews.extremebittorrent.com
[MOD] Simple sNews "PINGer"
« on: March 10, 2008, 01:15:06 pm »

I've modified this tiny script to work sNews. I've pinged pingomatic, technorati,google,feedburner with it. Works like a charm.
Here you go:
Code: [Select]
<?php
/**
 * @author invarbrass
 * @copyright 2008
 * @terms - use however you want just keep this info at the top.
 */
  
include('snews.php');
  
$title s('website_title');
  
$url   db('website');
  
  
$request xmlrpc_encode_request("weblogUpdates.ping", array($title$url) );

  
$header[] = "Host: ping.feedburner.com";
  
$header[] = "Content-type: text/xml";
  
$header[] = "Content-length: ".strlen($request) . "\r\n";
  
$header[] = $request;

  
$ch curl_init();
  
curl_setopt$chCURLOPT_URL"http://ping.feedburner.com");
  
curl_setopt$chCURLOPT_RETURNTRANSFER);
  
curl_setopt$chCURLOPT_HTTPHEADER$header );
  
curl_setopt$chCURLOPT_CUSTOMREQUEST'POST' );
  
$result curl_exec$ch );
  
curl_close($ch);

  echo 
$result;
?>

Put the code in a separate file, i.e. simple_ping.php and call it directly. You can use other ping servers by changing the url.
Hope this helps!  ;)
« Last Edit: March 10, 2008, 01:34:43 pm by invarbrass »
Logged