<commit_before># Webradio-API
A minimal multi-service orientied search and streaming API for your Multi Theft Auto server

## Getting Started
### Prerequisites
You need a web server like *nginx* or *apache* with PHP. The web server should serve content from the `public` directory and not anywhere else to reduce the attack margin to a minimum. Due to the early stages of the project you are forced to use `>= PHP 7` because the code uses e.g. the *null coalesce* operator, which was first introduced in PHP 7.

### Installing
Clone the repository to your disk, copy the `config.example.php` file as `config.php` in the *root*-directory and open it in an editor of your choice.

Remove the default key in the `$keys` array and add your own secret key strings to the array. There is no character limit on the keys and  you can use any character, whitespace too. Example:
```php
$keys = [
    "<KEY>", // You shouldn't use this one
    "<KEY>", // Neither this one
    // ...
];
```

Finally, you should add your private API keys for `YouTube`, `Soundcloud` and `Jamendo`. Other included services do not require an API key.

**Note:** You MUST configure your webserver to point to the `public` directory of the application.

### Shortcuts for API registration
* [YouTube](https://developers.google.com/youtube/registering_an_application#Create_API_Keys)
* [Soundcloud](http://soundcloud.com/you/apps)
* [Jamendo](https://devportal.jamendo.com/admin/applications)

### Development
You should set the `$debug_mode` variable in `config.php` to *true* if you want to receive the fine details of the exception whenever your application drops an `Out of Order` error.

## Usage
### Search
`/search.php?query=Bohemian+Rhapsody&service=YouTube&key=<a key from $keys>`  
`/search.php?query=Adele+Hello&service=Soundcloud&key=<a key from $keys>`  
`/search.php?query=Sunshine&service=Jamendo&key=<a key from $keys>`  
`/search.php?query=We+Right+Here&service=MyFreeMP3&key=<a key from $keys>`  <commit_msg>Fixed header level in README<commit_after># Webradio-API
A minimal multi-service orientied search and streaming API for your Multi Theft Auto server

## Getting Started
### Prerequisites
You need a web server like *nginx* or *apache* with PHP. The web server should serve content from the `public` directory and not anywhere else to reduce the attack margin to a minimum. Due to the early stages of the project you are forced to use `>= PHP 7` because the code uses e.g. the *null coalesce* operator, which was first introduced in PHP 7.

### Installing
Clone the repository to your disk, copy the `config.example.php` file as `config.php` in the *root*-directory and open it in an editor of your choice.

Remove the default key in the `$keys` array and add your own secret key strings to the array. There is no character limit on the keys and  you can use any character, whitespace too. Example:
```php
$keys = [
    "<KEY>", // You shouldn't use this one
    "<KEY>", // Neither this one
    // ...
];
```

Finally, you should add your private API keys for `YouTube`, `Soundcloud` and `Jamendo`. Other included services do not require an API key.

**Note:** You MUST configure your webserver to point to the `public` directory of the application.

#### Shortcuts for API registration
* [YouTube](https://developers.google.com/youtube/registering_an_application#Create_API_Keys)
* [Soundcloud](http://soundcloud.com/you/apps)
* [Jamendo](https://devportal.jamendo.com/admin/applications)

### Development
You should set the `$debug_mode` variable in `config.php` to *true* if you want to receive the fine details of the exception whenever your application drops an `Out of Order` error.

## Usage
### Search
`/search.php?query=Bohemian+Rhapsody&service=YouTube&key=<a key from $keys>`  
`/search.php?query=Adele+Hello&service=Soundcloud&key=<a key from $keys>`  
`/search.php?query=Sunshine&service=Jamendo&key=<a key from $keys>`  
`/search.php?query=We+Right+Here&service=MyFreeMP3&key=<a key from $keys>`  
{'fraction_non_alphanumeric': 0.10714285714285714, 'fraction_numerical': 0.0014985014985014985, 'mean_word_length': 4.713266761768901, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 17, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2030975', 'n_tokens_mistral': 1180, 'n_tokens_neox': 1151, 'n_words': 500}