Skip to content

Commit

Permalink
adding is.gd and gw.gd shorteners
Browse files Browse the repository at this point in the history
  • Loading branch information
neofutur committed Oct 13, 2010
1 parent 7bb38a2 commit 068ebf8
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
19 changes: 19 additions & 0 deletions inc/r2t/shortener/gwgd.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

class r2t_shortener_isgd {

protected $apiurl = 'http://gw.gd/api.php?format=text&long=';
function __construct() {
require_once ("HTTP/Request.php");

}

public function shorten($url) {

$req = new HTTP_Request($this->apiurl . urlencode($url));
if (!PEAR::isError($req->sendRequest())) {
return $req->getResponseBody();
}
return "";
}
}
19 changes: 19 additions & 0 deletions inc/r2t/shortener/isgd.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

class r2t_shortener_isgd {

protected $apiurl = 'http://is.gd/api.php?longurl=';
function __construct() {
require_once ("HTTP/Request.php");

}

public function shorten($url) {

$req = new HTTP_Request($this->apiurl . urlencode($url));
if (!PEAR::isError($req->sendRequest())) {
return $req->getResponseBody();
}
return "";
}
}

0 comments on commit 068ebf8

Please sign in to comment.