<commit_before>module PropertyScraper
  class TravelKeysScraper < Scraper

    def self.can_scrape?(url)
      url =~ /.*travelkeys.*\/villa-listing\/.*/
    end

    def name
      @name ||= self.find('#propertyname')
    end

    def location
      @location ||= self.find('#detailaddress')
    end

    def lat
    end

    def lng
    end

    def bedrooms
      @bedrooms ||= self.find('#detailremainder').match(/(\d+) Bedrooms/).try(:[], 1).try(strip)
    end

    def max_occupancy
    end

    def bathrooms
      @bathrooms ||= self.find('#detailremainder').match(/(\d+) Baths/).try(:[], 1).try(:strip)
    end

    def description
      @description ||= self.find('#description p')
    end

    def photos
      @wrapped_document.css('.singleimage img').map do |img|
        img.attr('src')
      end.compact.uniq
    end

    def price
      @from_price ||= self.find('#startingrate .currency-value')
    end

    def fees
      @fees ||= self.find('#charges')
    end

    def policies
      @policies ||= policies_section['policies']
    end

    def location_details
      @location_details ||= policies_section['distances']
    end

    def data<commit_msg>Added calendar url to the travel keys scraper<commit_after>module PropertyScraper
  class TravelKeysScraper < Scraper

    def self.can_scrape?(url)
      url =~ /.*travelkeys.*\/villa-listing\/.*/
    end

    def name
      @name ||= self.find('#propertyname')
    end

    def location
      @location ||= self.find('#detailaddress')
    end

    def lat
    end

    def lng
    end

    def bedrooms
      @bedrooms ||= self.find('#detailremainder').match(/(\d+) Bedrooms/).try(:[], 1).try(strip)
    end

    def max_occupancy
    end

    def bathrooms
      @bathrooms ||= self.find('#detailremainder').match(/(\d+) Baths/).try(:[], 1).try(:strip)
    end

    def description
      @description ||= self.find('#description p')
    end

    def photos
      @wrapped_document.css('.singleimage img').map do |img|
        img.attr('src')
      end.compact.uniq
    end

    def price
      @from_price ||= self.find('#startingrate .currency-value')
    end

    def fees
      @fees ||= self.find('#charges')
    end

    def policies
      @policies ||= policies_section['policies']
    end

    def location_details
      @location_details ||= policies_section['distances']
    end

    def calendar_url
      @calendar_url ||= @wrapped_document.at('iframe[src^="http://manage.myvacationrentalmanager"]').attr('src')
    end

    def data
{'fraction_non_alphanumeric': 0.1425168717745137, 'fraction_numerical': 0.0015879317189360857, 'mean_word_length': 2.5097493036211698, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2483338', 'n_tokens_mistral': 839, 'n_tokens_neox': 792, 'n_words': 173}