modified: library/slinky.php Set up tabs in code correctly.

This commit is contained in:
Keith Fernie 2012-02-09 21:44:52 +00:00
parent 955022e7dc
commit 2c9cfb1fe9
1 changed files with 16 additions and 16 deletions

View File

@ -181,11 +181,11 @@ class Slinky {
$this->service = new Slinky_Fongs(); $this->service = new Slinky_Fongs();
break; break;
} }
case $this->get( 'yourls-url' ): case $this->get( 'yourls-url' ):
if ( class_exists( 'Slinky_YourLS' ) ) { if ( class_exists( 'Slinky_YourLS' ) ) {
$this->service = new Slinky_YourLS(); $this->service = new Slinky_YourLS();
break; break;
} }
case 'micurl.com': case 'micurl.com':
if ( class_exists( 'Slinky_Micurl' ) ) { if ( class_exists( 'Slinky_Micurl' ) ) {
$this->service = new Slinky_Micurl(); $this->service = new Slinky_Micurl();
@ -581,27 +581,27 @@ class Slinky_Fongs extends Slinky_Service {
// yourls // yourls
class Slinky_YourLS extends Slinky_Service { class Slinky_YourLS extends Slinky_Service {
function url_is_short( $url ) { function url_is_short( $url ) {
return stristr( $url, 'shit.li/' ); return stristr( $url, 'shit.li/' );
} }
function url_is_long( $url ) { function url_is_long( $url ) {
return !stristr( $url, 'shit.li/' ); return !stristr( $url, 'shit.li/' );
} }
function make_short( $url ) { function make_short( $url ) {
echo $this->get( 'username' ); echo $this->get( 'username' );
$use_ssl = $this->get( 'ssl' ); $use_ssl = $this->get( 'ssl' );
if ( $use_ssl ) if ( $use_ssl )
$use_ssl = 's'; $use_ssl = 's';
else else
$use_ssl = ''; $use_ssl = '';
$result = $this->url_get( 'http'. $use_ssl . '://' . $this->get( 'yourls-url' ) . '/yourls-api.php?username=' . $this->get( 'username' ) . '&password=' . $this->get( 'password' ) . '&action=shorturl&format=simple&url=' . urlencode( $url ) ); $result = $this->url_get( 'http'. $use_ssl . '://' . $this->get( 'yourls-url' ) . '/yourls-api.php?username=' . $this->get( 'username' ) . '&password=' . $this->get( 'password' ) . '&action=shorturl&format=simple&url=' . urlencode( $url ) );
if ( 1 != $result && 2 != $result ) if ( 1 != $result && 2 != $result )
return $result; return $result;
else else
return $url; return $url;
} }
} }
// Micu.rl // Micu.rl