Skip to content

Instantly share code, notes, and snippets.

@mxlje
Created February 11, 2013 10:48
Show Gist options
  • Save mxlje/4753795 to your computer and use it in GitHub Desktop.
Save mxlje/4753795 to your computer and use it in GitHub Desktop.
Display current location on website, based on public Dropbox file
<?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;
?>
$(document).ready(function() {
$("#location").load('/get.php');
})
<span id="location">...</span>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment