Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

XML-RPC client to ping Technorati server

  • Loading branch information...
commit 47b908538d6c60e4056fcaee06461a37e46e7506 1 parent 3a04831
Sudheer Satyanarauana authored
Showing with 72 additions and 0 deletions.
  1. +72 −0 cli/scripts/standalone/service/Technorati/Ping.php
View
72 cli/scripts/standalone/service/Technorati/Ping.php
@@ -0,0 +1,72 @@
+<?php
+/**
+ * Copyright (c) 2009, Sudheera Satyanarayana.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification,
+ * are permitted provided that the following conditions are met:
+ *
+ * * Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * * Neither the names of Sudheera Satyanarayana nor the names of the project
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+*/
+
+
+/**
+ * Script to ping Technorati XML-RPC service
+ * Visit http://techchorus.net for detailed description
+ */
+
+/**
+ * Replace "Tech Chorus" with your site name
+ */
+
+$site_name = "Tech Chorus";
+
+/**
+ * The URL of your site
+ */
+$site_url = "http://techchorus.net";
+
+$request = xmlrpc_encode_request("weblogUpdates.ping", array($site_name, $site_url));
+
+#echo $request;
+
+$context = stream_context_create(array('http' => array(
+ 'method' => "POST",
+ 'header' => "Content-Type: text/xml\r\nUser-Agent: PHPRPC/1.0\r\nHost: rpc.technorati.com\r\n",
+ 'content' => $request
+)));
+
+$server = "http://rpc.technorati.com/rpc/ping";
+$file = file_get_contents($server, false, $context);
+
+$response = xmlrpc_decode($file);
+
+if (is_array($response) and xmlrpc_is_fault($response)){
+ echo "Failed to ping Technorati";
+} else {
+ echo "Successfully pinged Technorati";
+}
+
+
+

0 comments on commit 47b9085

Please sign in to comment.
Something went wrong with that request. Please try again.