Skip to content

Instantly share code, notes, and snippets.

@vseow
vseow / index.php
Last active September 3, 2019 09:35
Get Country from IP with PHP
<?php
$ip = $_SERVER['REMOTE_ADDR'];
//echo $ip;
// Docs: http://ip-api.com/docs/
// Capped at 250 lookups/min - can unban yourself if you go over http://ip-api.com/docs/unban
$xml = simplexml_load_file("http://ip-api.com/xml/".$ip);
echo $xml->country;
@vseow
vseow / wget.sh
Created November 10, 2015 23:17
Download from multiple links/URLs in a text file with wget
wget --content-disposition -i list-of-links.txt
# Make sure your URLs are in the following format: http://www.example.com