/** * !Pings weblogs.com, blo.gs, and others in the future * this is in it's own function so we can use register_shutdown_function */ function ping() { $weblogsparams[0] = C_BLOGNAME; $weblogsparams[1] = BLOGURL; $sites = explode(',', C_PING); if (count($sites) > 0) { foreach ($sites as $site) { $url = explode('/', $site); XMLRPC_request($url[0], "/" . $url[1], "weblogUpdates.ping", $weblogsparams, WEBLOG_XMLRPC_USERAGENT); } } }
<title>Example OpenThesaurus KD XML RPC News Client</title> </head> <body> <?php /* client.php */ include "kd_xmlrpc.php"; $query = "lange"; # must be in utf-8(?) #online server: $site = "www.openthesaurus.de"; $location = "/webservice/server.php"; #lokaler test: #$site = "localhost"; #$location = "/openthesaurus/www/webservice/server.php"; list($success, $response) = XMLRPC_request($site, $location, 'openthesaurus.searchSynonyms', array(XMLRPC_prepare($query))); if ($success) { $count = 0; while (list($key, $val) = each($response)) { print join(', ', $response[$count]['words']); print "<br />"; $count++; } } else { print "<p>Error: " . nl2br($response['faultString']); } ?> </body> </html>
// Include the xmlrpc library. require_once 'kd_xmlrpc.php'; $mgSessionId = $_SERVER['REQUEST_METHOD'] == "POST" ? $_POST['SESSION'] : $_GET['SESSION']; $success = false; $long = 0; $lat = 0; try { // Initialize the Web Extensions and connect to the Server using // the Web Extensions session identifier stored in PHP session state. MgInitializeWebTier($configFilePath); $userInfo = new MgUserInformation($mgSessionId); $siteConnection = new MgSiteConnection(); $siteConnection->Open($userInfo); $address = $_GET['address'] . ', Sheboygan, WI'; // Make the request to geocoder.us passing the address. list($success, $response) = XMLRPC_request('rpc.geocoder.us', '/service/xmlrpc', 'geocode', array(XMLRPC_prepare($address))); // Stuff the response into a new variable: $nested_array = $response; // For some reason (presumably a good one), geocoder.us responds with a nested // array. We need to extract the inner array from the outer and stuff it into a // new variable: $geoarray = array_pop($nested_array); // The $success variable is intended for error handling, but since geocoder.us // will send an error response to invalid queries (thus flagging $success to 1), // we can't use this to check for errors. Instead, we'll check the values in the // array and deem success or failure based on that. if (array_key_exists('lat', $geoarray) && array_key_exists('long', $geoarray)) { // The geocode successfully returned a location. $lat = $geoarray['lat']; $long = $geoarray['long']; // Build an address1 and address2 variables from the result.
<?php include 'inc/xmlrpc.php'; $pingname = $settings['sitename']; $pingfeed = $settings['url'] . "/podcast.php"; $pingurl = $settings['url']; //ping audio.weblogs.com @XMLRPC_request("audiorpc.weblogs.com", "/RPC2", "weblogUpdates.ping", array(XMLRPC_prepare($pingname), XMLRPC_prepare($pingurl)), "Loudblog"); //user agent //ping audio.weblogs.com RSS @XMLRPC_request("audiorpc.weblogs.com", "/RPC2", "rssUpdate", array(XMLRPC_prepare($pingname), XMLRPC_prepare($pingfeed)), "Loudblog"); //user agent //ping ping-o-matic @XMLRPC_request("rpc.pingomatic.com", "/RPC2", "weblogUpdates.ping", array(XMLRPC_prepare($pingname), XMLRPC_prepare($pingurl), XMLRPC_prepare(""), XMLRPC_prepare($pingfeed)), "Loudblog"); //user agent