Browse Source

remove unused functions

master
Aaron Parecki 7 years ago
parent
commit
090c2d30da
No known key found for this signature in database GPG Key ID: 276C2817346D6056
1 changed files with 0 additions and 37 deletions
  1. +0
    -37
      lib/helpers.php

+ 0
- 37
lib/helpers.php View File

@ -149,43 +149,6 @@ function k($a, $k, $default=null) {
} }
} }
function get_timezone($lat, $lng) {
try {
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://atlas.p3k.io/api/timezone?latitude='.$lat.'&longitude='.$lng);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
$tz = @json_decode($response);
if($tz)
return new DateTimeZone($tz->timezone);
} catch(Exception $e) {
return null;
}
return null;
}
function micropub_post($endpoint, $params, $access_token, $h='entry') {
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $endpoint);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Authorization: Bearer ' . $access_token
));
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query(array_merge(array(
'h' => $h
), $params)));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HEADER, true);
$response = curl_exec($ch);
$error = curl_error($ch);
return array(
'response' => $response,
'error' => $error,
'curlinfo' => curl_getinfo($ch),
'status' => curl_getinfo($ch, CURLINFO_HTTP_CODE)
);
}
function relative_time($date) { function relative_time($date) {
static $rel; static $rel;
if(!isset($rel)) { if(!isset($rel)) {

Loading…
Cancel
Save