ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e
proxy_ylocal.php
Go to the documentation of this file.
1 <?php
2 
3 /* yadl_spaceid - Skip Stamping */
4 
5 // Yahoo! proxy
6 
7 // Hard-code hostname and path:
8 define ('PATH', 'http://local.yahooapis.com/LocalSearchService/V2/localSearch');
9 
10 $type = "text/xml";
11 
12 // Get all query params
13 $query = "?";
14 foreach ($_GET as $key => $value) {
15  if(($key == "output") && ($value == "json")) {
16  $type = "application/json";
17  }
18  $query .= urlencode($key)."=".urlencode($value)."&";
19 }
20 
21 foreach ($_POST as $key => $value) {
22  if(($key == "output") && ($value == "json")) {
23  $type = "application/json";
24  }
25  $query .= $key."=".$value."&";
26 }
27 $query .= "appid=YahooDemo";
28 $url = PATH.$query;
29 
30 
31 // Open the Curl session
32 $session = curl_init($url);
33 
34 // Don't return HTTP headers. Do return the contents of the call
35 curl_setopt($session, CURLOPT_HEADER, false);
36 curl_setopt($session, CURLOPT_RETURNTRANSFER, true);
37 
38 // Make the call
39 $response = curl_exec($session);
40 
41 header("Content-Type: ".$type);
43 curl_close($session);
44 
45 ?>
$type
$_GET["client_id"]
$session
const PATH
Definition: proxy_ylocal.php:8
$query
$url
$response
$key
Definition: croninfo.php:18
$_POST["username"]