Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $url="https://api.airbnb.com/v2/search_results?client_id=3092nxybyb0otqw18e8nh5nty&locale=es-ES¤cy=EUR&_format=for_search_results&_limit=$limit&_offset=$offset&fetch_facets=true&guests=1&ib=false&ib_add_photo_flow=true&location=Las-Palmas-de-Gran-Canaria--Espa%25C3%25B1a&min_bathrooms=1&min_bedrooms=1&min_beds=1&min_num_pic_urls=0&price_max=1000&price_min=9&sort=1&user_lat=28.1132&user_lng=-15.4409";
- $ci = curl_init();
- curl_setopt_array( $ci, array(CURLOPT_URL => $url,CURLOPT_TIMEOUT => 3600, CURLOPT_RETURNTRANSFER => true));
- $result = curl_exec($ci);
- curl_close($ci);
- $data = json_decode($result, true);
- if(count($data['search_results']) == 0) die("No more listings");
- foreach($data['search_results'] as $d) {
- $id = $d['listing']['id'];
- $urlita = "https://api.airbnb.com/v2/reviews?client_id=3092nxybyb0otqw18e8nh5nty&listing_id=$id&role=all";
- $cii = curl_init();
- curl_setopt_array( $cii, array(CURLOPT_URL => $urlita,CURLOPT_TIMEOUT => 3600, CURLOPT_RETURNTRANSFER => true));
- $reviewResult = curl_exec($cii);
- curl_close($cii);
- $review = json_decode($reviewResult, true);
- foreach($review['reviews'] as $r){
- echo $r['author']['acceptance_rate'] . ";";
- echo $r['author']['created_at'] . ";";
- echo $r['author']['first_name'] . ";";
- echo $r['author']['has_profile_pic'] . ";";
- echo $r['author']['id'] . ";";
- echo $r['author']['identity_mt_verified'] . ";";
- echo $r['author']['identity_v2_verified'] . ";";
- echo $r['author']['identity_verified'] . ";";
- echo $r['author']['is_superhost'] . ";";
- echo $r['author']['is_trip_host'] . ";";
- echo $r['author']['picture_large_url'] . ";";
- echo $r['author']['picture_url'] . ";";
- echo $r['author']['recommendation_count'] . ";";
- echo $r['author']['response_rate'] . ";";
- echo $r['author']['response_time'] . ";";
- echo $r['author']['reviewee_count'] . ";";
- echo $r['author']['thumbnail_medium_url'] . ";";
- echo $r['author']['thumbnail_url'] . ";";
- echo $r['author_id'] . ";";
- echo $r['can_be_edited'] . ";";
- echo $r['comments'] . ";";
- echo $r['created_at'] . ";";
- echo $r['id'] . ";";
- echo $r['listing_id'] . ";";
- echo $r['recipient_id'] . ";";
- echo "n";
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement