Skip to content

Commit

Permalink
More comments
Browse files Browse the repository at this point in the history
git-svn-id: http://yourls.googlecode.com/svn/trunk@434 12232710-3e20-11de-b438-597f59cd7555
  • Loading branch information
ozh committed Jul 1, 2010
1 parent a72ffa4 commit 672356e
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions yourls-api.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

switch( $action ) {

// Shorten a URL
case 'shorturl':
$url = ( isset( $_REQUEST['url'] ) ? $_REQUEST['url'] : '' );
$keyword = ( isset( $_REQUEST['keyword'] ) ? $_REQUEST['keyword'] : '' );
Expand All @@ -18,22 +19,26 @@
unset( $return['html'] ); // in API mode, no need for our internal HTML output
break;

// Global stats
case 'stats':
$filter = ( isset( $_REQUEST['filter'] ) ? $_REQUEST['filter'] : '' );
$limit = ( isset( $_REQUEST['limit'] ) ? $_REQUEST['limit'] : '' );
$return = yourls_api_stats( $filter, $limit );
break;


// Stats for a shorturl
case 'url-stats':
$shorturl = ( isset( $_REQUEST['shorturl'] ) ? $_REQUEST['shorturl'] : '' );
$return = yourls_api_url_stats( $shorturl );
break;

// Expand a short link
case 'expand':
$shorturl = ( isset( $_REQUEST['shorturl'] ) ? $_REQUEST['shorturl'] : '' );
$return = yourls_api_expand( $shorturl );
break;


// Missing or incorrect action parameter
default:
$return = array(
'errorCode' => 400,
Expand Down

0 comments on commit 672356e

Please sign in to comment.