You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

houses.js 1.3KB

1234567891011121314151617181920212223242526272829303132
  1. module.exports.house = function($) {
  2. var result = {
  3. name: $('#propertyName').text(),
  4. description: $('#descriptionSection>p').html(),
  5. address: {
  6. street: $('.propertyAddressContainer h2>span:nth-child(1)').text(),
  7. city: $('.propertyAddressContainer h2>span:nth-child(2)').text(),
  8. zip: {
  9. state: $('.propertyAddressContainer .stateZipContainer>span:nth-child(1)').text(),
  10. code: $('.propertyAddressContainer .stateZipContainer>span:nth-child(2)').text(),
  11. }
  12. },
  13. contact: {
  14. phone: $('.contactInfo .phoneNumber span').html(),
  15. //language: $('.contactInfo .languages span').html(),
  16. url: $('.contactInfo .mortar-wrapper a').attr('href'),
  17. // officeHours: $('.daysHoursContainer').map(function () {
  18. // return {
  19. // days: $(this).find('.days').text(),
  20. // hours: $(this).find('.hours').text(),
  21. // };
  22. // }).get()
  23. },
  24. };
  25. var data = JSON.parse(JSON.stringify(result)
  26. .split(' ').join('')
  27. .split(' ').join('')
  28. .split(' ').join('')
  29. .split(' ').join('')
  30. .split('\\n').join(''));
  31. return data;
  32. }