]> git.mxchange.org Git - friendica-addons.git/blob - jappixmini/jappix/php/geolocation.php
Twitter: Fetch the contact relation
[friendica-addons.git] / jappixmini / jappix / php / geolocation.php
1 <?php
2
3 /*
4
5 Jappix - An open social platform
6 This is the Jappix geolocation script
7
8 -------------------------------------------------
9
10 License: AGPL
11 Author: Vanaryon
12 Last revision: 15/01/12
13
14 */
15
16 // PHP base
17 define('JAPPIX_BASE', '..');
18
19 // Get the needed files
20 require_once('./functions.php');
21 require_once('./read-main.php');
22 require_once('./read-hosts.php');
23
24 // Optimize the page rendering
25 hideErrors();
26 compressThis();
27
28 // Not allowed for a special node
29 if(isStatic() || isUpload())
30         exit;
31
32 // If valid data was sent
33 if((isset($_GET['latitude']) && !empty($_GET['latitude'])) && (isset($_GET['longitude']) && !empty($_GET['longitude'])) && (isset($_GET['language']) && !empty($_GET['language']))) {
34         // Set a XML header
35         header('Content-Type: text/xml; charset=utf-8');
36         
37         // Get the XML content
38         $xml = read_url('http://maps.googleapis.com/maps/api/geocode/xml?latlng='.urlencode($_GET['latitude']).','.urlencode($_GET['longitude']).'&language='.urlencode($_GET['language']).'&sensor=true');
39         
40         exit($xml);
41 }
42
43 ?>