Created
February 11, 2013 10:48
-
-
Save mxlje/4753795 to your computer and use it in GitHub Desktop.
Display current location on website, based on public Dropbox file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
# File to load | |
$file = curl_init('http://dl.dropbox.com/u/YOUR-ID/location.txt'); | |
curl_setopt($file,CURLOPT_USERAGENT,'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:7.0.1) Gecko/20100101 Firefox/7.0.1'); | |
$html = curl_exec($file); | |
return $html; | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function() { | |
$("#location").load('/get.php'); | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<span id="location">...</span> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment