diff --git a/htdocs/application/config/stikked.php b/htdocs/application/config/stikked.php index cdf3bad..f4d99f1 100755 --- a/htdocs/application/config/stikked.php +++ b/htdocs/application/config/stikked.php @@ -28,16 +28,6 @@ $config['db_password'] = 'stikked'; */ $config['combine_assets'] = false; -/** - * Bit.ly config - * - * The username & API-Key for bit.ly - * (get one at: http://bitly.com/a/your_api_key) - * -**/ -$config['bitly_username'] = ''; -$config['bitly_apikey'] = ''; - /** * Key for Cron * @@ -47,6 +37,15 @@ $config['bitly_apikey'] = ''; **/ $config['cron_key'] = ''; +/** + * gw.gd config + * + * Your own instance of the gw.gd URL-shortener (Download: https://github.com/neofutur/gwgd) + * Default: http://gw.gd/ + * +**/ +$config['gwgd_url'] = ''; + /** * Credentials for the backup URL * diff --git a/htdocs/application/models/pastes.php b/htdocs/application/models/pastes.php index 2cae1b2..63043c3 100755 --- a/htdocs/application/models/pastes.php +++ b/htdocs/application/models/pastes.php @@ -135,16 +135,15 @@ class Pastes extends CI_Model { $url = site_url('view/' . $data['pid']); $url = urlencode($url); - $bitly_username = $this->config->item('bitly_username'); - $bitly_apikey = $this->config->item('bitly_apikey'); - $target = 'http://api.bitly.com/v3/shorten?login=' . $bitly_username . '&apiKey=' . $bitly_apikey . '&longUrl=' . $url; + $config_gwgd_url = $this->config->item('gwgd_url'); + $gwgd_url = ($config_gwgd_url ? $config_gwgd_url : 'http://gw.gd/'); + $target = $gwgd_url . 'api.php?long=' . $url; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $target); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $resp = curl_exec($ch); curl_close($ch); - $resp = json_decode($resp); - $data['snipurl'] = $resp->data->url; + $data['snipurl'] = $resp; if (empty($data['snipurl'])) { diff --git a/htdocs/application/views/defaults/paste_form.php b/htdocs/application/views/defaults/paste_form.php index 4e2f93b..d14924c 100644 --- a/htdocs/application/views/defaults/paste_form.php +++ b/htdocs/application/views/defaults/paste_form.php @@ -53,7 +53,7 @@
-