<p>The <code>getContents</code> function uses <ahref="https://secure.php.net/manual/en/book.curl.php"class="Link--external"rel="noopener noreferrer">cURL</a> to acquire data from the specified URI while respecting the various settings defined at a global level by RSS-Bridge (i.e., proxy host, user agent, etc.). This function accepts a few parameters:</p>
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Type</th>
<th>Optional</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>url</code></td>
<td>string</td>
<td><em>required</em></td>
<td>The URL of the contents to acquire</td>
</tr>
<tr>
<td><code>header</code></td>
<td>array</td>
<td><em>optional</em></td>
<td>An array of HTTP header fields to set, in the format <code>array('Content-type: text/plain', 'Content-length: 100')</code>, see <ahref="https://secure.php.net/manual/en/function.curl-setopt.php"class="Link--external"rel="noopener noreferrer">CURLOPT_HTTPHEADER</a></td>
</tr>
<tr>
<td><code>opts</code></td>
<td>array</td>
<td><em>optional</em></td>
<td>An array of cURL options in the format <code>array(CURLOPT_POST => 1);</code>, see <ahref="https://secure.php.net/manual/en/function.curl-setopt.php"class="Link--external"rel="noopener noreferrer">curl_setopt</a> for a complete list of options.</td>
<p>The <code>getSimpleHTMLDOM</code> function is a wrapper for the <ahref="http://simplehtmldom.sourceforge.net/"class="Link--external"rel="noopener noreferrer">simple_html_dom</a><ahref="http://simplehtmldom.sourceforge.net/manual_api.htm#api"class="Link--external"rel="noopener noreferrer">file_get_html</a> function in order to provide context by design.</p>
<p>The <code>getSimpleHTMLDOMCached</code> function does the same as the <ahref="#getsimplehtmldom"><code>getSimpleHTMLDOM</code></a> function, except that the content received for the given URI is stored in a cache and loaded from cache on the next request if the specified cache duration was not reached. Use this function for data that is very unlikely to change between consecutive requests to <strong>RSS-Bridge</strong>. This function allows to specify the cache duration with the second parameter (default is 24 hours / 86400 seconds).</p>
<p><strong>Notice:</strong> Due to the current implementation a value greater than 86400 seconds (24 hours) will not work as the cache is purged every 24 hours automatically.</p>
<p><strong>Notice:</strong> Whenever possible make use of <ahref="#returnclienterror"><code>returnClientError</code></a> or <ahref="#returnservererror"><code>returnServerError</code></a></p>
<p>The <code>returnError</code> function aborts execution of the current bridge and returns the given error message with the provided error number:</p>
<p>Check the <ahref="https://en.wikipedia.org/wiki/List_of_HTTP_status_codes"class="Link--external"rel="noopener noreferrer">list of error codes</a> for applicable error numbers.</p>
<p>The <code>returnClientError</code> function aborts execution of the current bridge and returns the given error message with error code <strong>400</strong>:</p>
<p>The <code>returnServerError</code> function aborts execution of the current bridge and returns the given error message with error code <strong>500</strong>:</p>
<p>Use this function when a problem occurs that has nothing to do with the parameters provided by the user. (like: Host service gone missing, empty data received, etc…)</p>
<p>Automatically replaces any relative URL in a given string or DOM object (i.e. the one returned by <ahref="#getsimplehtmldom">getSimpleHTMLDOM</a>) with an absolute URL.</p>
window.searchTranslation = {"Search_one_result":"1 result","Search_results":"!count results","Search_no_results":"Nothing found","Search_common_words_ignored":"Common words are largely ignored","Search_too_short":"Search too short","Search_one_character_or_more":"Should be one character or more","Search_should_be_x_or_more":"Should be !min characters or more","Link_previous":"Previous","Link_next":"Next"};