This file contains hidden or 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 | |
function whois_query($domain) { | |
// fix the domain name: | |
$domain = strtolower(trim($domain)); | |
$domain = preg_replace('/^http:\/\//i', '', $domain); | |
$domain = preg_replace('/^www\./i', '', $domain); | |
$domain = explode('/', $domain); | |
$domain = trim($domain[0]); |
This file contains hidden or 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 | |
function currency($from_Currency,$to_Currency,$amount) { | |
$amount = urlencode($amount); | |
$from_Currency = urlencode($from_Currency); | |
$to_Currency = urlencode($to_Currency); | |
$url = "http://www.google.com/ig/calculator?hl=en&q=$amount$from_Currency=?$to_Currency"; | |
$ch = curl_init(); | |
$timeout = 0; | |
curl_setopt ($ch, CURLOPT_URL, $url); | |
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1); |
This file contains hidden or 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
function isDomainAvailible($domain) | |
{ | |
//check, if a valid url is provided | |
if(!filter_var($domain, FILTER_VALIDATE_URL)) | |
{ | |
return false; | |
} | |
//initialize curl | |
$curlInit = curl_init($domain); |
This file contains hidden or 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
function get_favicon($url){ | |
$url = str_replace("http://",'',$url); | |
return "http://www.google.com/s2/favicons?domain=".$url; | |
} |
This file contains hidden or 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
function getLatLong($address){ | |
if (!is_string($address))die("All Addresses must be passed as a string"); | |
$_url = sprintf('http://maps.google.com/maps?output=js&q=%s',rawurlencode($address)); | |
$_result = false; | |
if($_result = file_get_contents($_url)) { | |
if(strpos($_result,'errortips') > 1 || strpos($_result,'Did you mean:') !== false) return false; | |
preg_match('!center:\s*{lat:\s*(-?\d+\.\d+),lng:\s*(-?\d+\.\d+)}!U', $_result, $_match); | |
$_coords['lat'] = $_match[1]; | |
$_coords['long'] = $_match[2]; | |
} |
This file contains hidden or 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
function IPGeolocation($IpOrHostname,$Format="json"){ | |
$response = file_get_contents("http://freegeoip.net/".$Format."/".$IpOrHostname); | |
return json_decode($response); | |
} | |
print_r(IPGeolocation("86.124.164.62")); |
This file contains hidden or 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
var GeoPosition; | |
/** | |
* get browser geolocation via html5 | |
* @constructor | |
*/ | |
function GetGeolocation() { | |
if (navigator.geolocation) { | |
navigator.geolocation.getCurrentPosition(function (position) { | |
GeoPosition = position; | |
}) |
This file contains hidden or 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 | |
/** | |
* IMDB Wrapper API | |
* Wrapper class to retrieve data from IMDB | |
* http://jogisilalahi.com/blog/imdb-api-wrapper-class-php | |
* @author Jogi Silalahi <[email protected]> | |
*/ | |
class IMDB |
This file contains hidden or 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 | |
/** | |
* MultiCurl class library is a PHP solution for work with MULTI CURL extension. | |
* It provides to execute some parallel HTTP requests with limit of downloaded | |
* size. Example: start 100 downloads with 2 parallel sessions, and get only | |
* first 100 Kb per session. | |
* | |
* This library is free software; you can redistribute it and/or | |
* modify it under the terms of the GNU Lesser General Public | |
* License as published by the Free Software Foundation; either |
This file contains hidden or 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 | |
function prettyDate($date){ | |
$time = strtotime($date); | |
$now = time(); | |
$ago = $now - $time; | |
if($ago < 60){ | |
$when = round($ago); | |
$s = ($when == 1)?"second":"seconds"; | |
return "$when $s ago"; | |
}elseif($ago < 3600){ |
OlderNewer