Exemple #1
0
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
use Trivago\Tas\Request\HotelDetailsRequest;
use Trivago\Tas\Request\HotelRatesRequest;
$config = (require_once __DIR__ . '/../config.php');
$tas = new \Trivago\Tas\Tas($config);
$hotelId = isset($_GET['item']) ? $_GET['item'] : null;
$dealsRequest = new HotelRatesRequest([HotelRatesRequest::ITEM => $hotelId]);
$hotelDeals = $tas->getHotelRates($dealsRequest);
$hotelDetails = $tas->getHotelDetails(new HotelDetailsRequest($hotelId));
?>

<!doctype html>
<html>
<head>
    <?php 
if (!$hotelDeals->pollingFinished()) {
    ?>
        <meta http-equiv="refresh" content="2">
    <?php 
}
Exemple #2
0
 * Copyright 2016 trivago GmbH
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
$config = (require_once __DIR__ . '/../config.php');
$tas = new \Trivago\Tas\Tas($config);
$hotelTags = $tas->getHotelTags(new \Trivago\Tas\Request\HotelTagsRequest());
?>

<h2>Hotel-Tag-Groups</h2>
<table border="1">
    <thead>
        <tr>
            <th>Group-ID</th>
            <th>Name</th>
            <th>Type</th>
        </tr>
    </thead>
    <tbody>
    <?php 
foreach ($hotelTags->getTagGroups() as $tagGroup) {
Exemple #3
0
 * Copyright 2016 trivago GmbH
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
$config = (require_once __DIR__ . '/../config.php');
$tas = new \Trivago\Tas\Tas($config);
$searchTerm = isset($_GET['query']) ? $_GET['query'] : '';
$locations = [];
if (!empty($searchTerm)) {
    $locations = $tas->getLocations(new \Trivago\Tas\Request\LocationsRequest($searchTerm));
}
/**
 * Replaces highlighted terms with corret HTML.
 *
 * Example: 'Hotel {Berlin}' becomes 'Hotel <strong>Berlin</strong>'
 *
 * @param string $name
 *
 * @return string
 */
function highlight_search_term($name)
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
use Trivago\Tas\Request\HotelCollectionRequest;
$config = (require_once __DIR__ . '/../config.php');
$tas = new \Trivago\Tas\Tas($config);
$path = isset($_GET['path']) ? $_GET['path'] : null;
$item = isset($_GET['item']) ? $_GET['item'] : null;
$offset = isset($_GET['offset']) ? $_GET['offset'] : 0;
$request = new HotelCollectionRequest([HotelCollectionRequest::PATH => $path, HotelCollectionRequest::ITEM => $item, HotelCollectionRequest::LIMIT => 25, HotelCollectionRequest::OFFSET => $offset]);
$hotelCollection = $tas->getHotelCollection($request);
?>

<!doctype html>
<html>
<head>
    <?php 
if (!$hotelCollection->pollingFinished()) {
    ?>
        <meta http-equiv="refresh" content="2">
    <?php