]> CyberLeo.Net >> Repos - Github/YOURLS.git/blob - yourls-api.php
Improving the API functions and API sample file to reflect the new auth system
[Github/YOURLS.git] / yourls-api.php
1 <?php\r
2 define('YOURLS_API', true);\r
3 require_once( dirname(__FILE__).'/includes/config.php' );\r
4 if ( defined('YOURLS_PRIVATE') && YOURLS_PRIVATE == true )\r
5         require_once( dirname(__FILE__).'/includes/auth.php' );\r
6 \r
7 \r
8 $db = yourls_db_connect();\r
9 $return = yourls_add_new_link( $_REQUEST['url'], $_REQUEST['keyword'], $db );\r
10 \r
11 yourls_api_output( $_REQUEST['format'], $return );\r
12 \r
13 die();