1
0
mirror of https://github.com/gamaio/lobli.git synced 2025-08-13 10:18:45 +00:00

Minor mod to API, make chrome extension work with beta

@Doridian recommended being able to change expiring time, so I did that
Chrome extension now shortens links with the beta right in the browser
This commit is contained in:
alopexc0de
2014-08-29 17:54:26 -04:00
parent 26d460b173
commit 6eb32ed84f
2 changed files with 10 additions and 8 deletions

View File

@@ -12,6 +12,8 @@
if(isset($_GET['shorten'])){
$short = $_GET['url'];
$expire = 2;
if(!empty($_GET['time']) && is_numeric($_GET['time'])) $expire = $_GET['time'];
if(strpos($short, "http://") === false && strpos($short, "https://") === false){ $short = "http://$short"; }
$apip = $redis->get("api:ip:$ip");
@@ -22,7 +24,7 @@
die("Too many requests too fast!");
}
$reShort = shorten($redis, $short, 2, $seperator);
$reShort = shorten($redis, $short, $expire, $seperator);
$reShort = explode($seperator, $reShort);
$retCode = $reShort[0];
@@ -52,7 +54,7 @@
break;
}
exit;
}elseif(isset($_GET['resolve'])){ die("Not ready"); }
else{ die("Improper Call."); }
}elseif(isset($_GET['resolve'])){ die("Not ready");
}else{ die("Improper Call."); }
?>
?>