diff options
author | ozhozh <ozhozh@12232710-3e20-11de-b438-597f59cd7555> | 2009-09-13 15:28:41 +0400 |
---|---|---|
committer | ozhozh <ozhozh@12232710-3e20-11de-b438-597f59cd7555> | 2009-09-13 15:28:41 +0400 |
commit | 4640259e6b4414e29fb86d027de2b8f63983e3a7 (patch) | |
tree | 5ee504d5d026987342f92e3ec93673c54a210cb8 /yourls-api.php | |
parent | 15c424c2ed95365f29bd1bd76120b85fa25fa21c (diff) |
Add 'expand' method to API. Fixes issue 48.
git-svn-id: http://yourls.googlecode.com/svn/trunk@143 12232710-3e20-11de-b438-597f59cd7555
Diffstat (limited to 'yourls-api.php')
-rw-r--r-- | yourls-api.php | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/yourls-api.php b/yourls-api.php index 038bfebb..f9e16b85 100644 --- a/yourls-api.php +++ b/yourls-api.php @@ -14,6 +14,7 @@ switch( $action ) { $url = ( isset( $_REQUEST['url'] ) ? $_REQUEST['url'] : '' );
$keyword = ( isset( $_REQUEST['keyword'] ) ? $_REQUEST['keyword'] : '' );
$return = yourls_add_new_link( $url, $keyword );
+ $return['simple'] = $return['shorturl']; // This one will be used in case output mode is 'simple'
unset($return['html']); // in API mode, no need for our internal HTML output
break;
@@ -23,6 +24,11 @@ switch( $action ) { $return = yourls_api_stats( $filter, $limit );
break;
+ case 'expand':
+ $shorturl = ( isset( $_REQUEST['shorturl'] ) ? $_REQUEST['shorturl'] : '' );
+ $return = yourls_api_expand( $shorturl );
+ break;
+
default:
die( 'Unknown "action" parameter' );
|