if(!$response) return;
return current(json_decode($response)->results)->hashUrl;
}
-}
+ function onPluginVersion(&$versions)
+ {
+ $versions[] = array('name' => sprintf('BitlyUrl (%s)', $this->shortenerName),
+ 'version' => STATUSNET_VERSION,
+ 'author' => 'Craig Andrews',
+ 'homepage' => 'http://status.net/wiki/Plugin:BitlyUrl',
+ 'rawdescription' =>
+ sprintf(_m('Uses <a href="http://%1$s/">%1$s</a> URL-shortener service.'),
+ $this->shortenerName));
+
+ return true;
+ }
+}
protected function shorten($url) {
$data = array('longurl' => $url);
-
+
$responseBody = $this->http_post($this->serviceUrl,$data);
-
+
if (!$responseBody) return;
$y = @simplexml_load_string($responseBody);
if (!isset($y->body)) return;
return strval($x['href']);
}
}
+
+ function onPluginVersion(&$versions)
+ {
+ $versions[] = array('name' => sprintf('LilUrl (%s)', $this->shortenerName),
+ 'version' => STATUSNET_VERSION,
+ 'author' => 'Craig Andrews',
+ 'homepage' => 'http://status.net/wiki/Plugin:LilUrl',
+ 'rawdescription' =>
+ sprintf(_m('Uses <a href="http://%1$s/">%1$s</a> URL-shortener service.'),
+ $this->shortenerName));
+
+ return true;
+ }
}
return strval($xml['href']);
}
}
+
+ function onPluginVersion(&$versions)
+ {
+ $versions[] = array('name' => sprintf('PtitUrl (%s)', $this->shortenerName),
+ 'version' => STATUSNET_VERSION,
+ 'author' => 'Craig Andrews',
+ 'homepage' => 'http://status.net/wiki/Plugin:PtitUrl',
+ 'rawdescription' =>
+ sprintf(_m('Uses <a href="http://%1$s/">%1$s</a> URL-shortener service.'),
+ $this->shortenerName));
+
+ return true;
+ }
}
protected function shorten($url) {
return $this->http_get(sprintf($this->serviceUrl,urlencode($url)));
}
+
+ function onPluginVersion(&$versions)
+ {
+ $versions[] = array('name' => sprintf('SimpleUrl (%s)', $this->shortenerName),
+ 'version' => STATUSNET_VERSION,
+ 'author' => 'Craig Andrews',
+ 'homepage' => 'http://status.net/wiki/Plugin:SimpleUrl',
+ 'rawdescription' =>
+ sprintf(_m('Uses <a href="http://%1$s/">%1$s</a> URL-shortener service.'),
+ $this->shortenerName));
+
+ return true;
+ }
}
return strval($xml['href']);
}
}
+
+ function onPluginVersion(&$versions)
+ {
+ $versions[] = array('name' => sprintf('TightUrl (%s)', $this->shortenerName),
+ 'version' => STATUSNET_VERSION,
+ 'author' => 'Craig Andrews',
+ 'homepage' => 'http://status.net/wiki/Plugin:TightUrl',
+ 'rawdescription' =>
+ sprintf(_m('Uses <a href="http://%1$s/">%1$s</a> URL-shortener service.'),
+ $this->shortenerName));
+ return true;
+ }
}