Greasy Fork is available in English.

PropertyguruAssist

one button click -> simplify propertyguru listing info for easily copy / paste

// ==UserScript==
// @name         PropertyguruAssist
// @namespace    http://tampermonkey.net/
// @version      0.6
// @description  one button click -> simplify propertyguru listing info for easily copy / paste
// @author       EnginePlus
// @match        https://*.propertyguru.com.sg/listing/*
// @grant        none
// @resource     customCSS https://cdn.jsdelivr.net/npm/bootstrap@4.4.1/dist/css/bootstrap.min.css
// @require      https://greasyfork.org/scripts/27254-clipboard-js/code/clipboardjs.js?version=174357
// @require      https://cdn.jsdelivr.net/npm/jquery@3.4.1/dist/jquery.slim.min.js
// ==/UserScript==

(function() {
    'use strict';
  // 根据item下label获取对应value值
  function getValueByLabel(items, label) { return (items.find(item => item.label === label) || {}).value || "N.A."; }

  // 获取JSON数据内容
  var url         = window.location.href;
  var jsonData    = JSON.parse(document.getElementById('__NEXT_DATA__').textContent);
  var propetyName = jsonData.props.pageProps.pageData.data.listingData.localizedTitle;
  var propetyType = getValueByLabel(jsonData.props.pageProps.pageData.data.detailsData.metatable.items,"Property Type");
  var floorSize   = getValueByLabel(jsonData.props.pageProps.pageData.data.detailsData.metatable.items,"Floor Size");
  var tenureType  = getValueByLabel(jsonData.props.pageProps.pageData.data.detailsData.metatable.items,"Tenure");
  var listDate 	  = getValueByLabel(jsonData.props.pageProps.pageData.data.detailsData.metatable.items,"Listed On");
  var listID 	  = getValueByLabel(jsonData.props.pageProps.pageData.data.detailsData.metatable.items,"Listing ID");
  var floorLevel  = getValueByLabel(jsonData.props.pageProps.pageData.data.detailsData.metatable.items,"Floor Level");
  var topYear     = getValueByLabel(jsonData.props.pageProps.pageData.data.detailsData.metatable.items,"TOP");
  var totalUnits  = getValueByLabel(jsonData.props.pageProps.pageData.data.detailsData.metatable.items,"Total Units");


  var bedNum 		= jsonData.props.pageProps.pageData.data.propertyOverviewData.propertyInfo.amenities[0].text;
  var bathNum 	= jsonData.props.pageProps.pageData.data.propertyOverviewData.propertyInfo.amenities[1].text;
  var price 	= jsonData.props.pageProps.pageData.data.propertyOverviewData.propertyInfo.price.amount;
  //var floorSize 	= jsonData.props.pageProps.pageData.data.propertyOverviewData.propertyInfo.amenities[2].text;

  var agentName	= jsonData.props.pageProps.pageData.data.contactAgentData.contactAgentCard.agentInfoProps.agent.name;
  var phoneNumber = jsonData.props.pageProps.pageData.data.contactAgentData.contactAgentCard.contactActions[1].phoneNumber;
  var clipboardText = url + '	'
                        + propetyName + ' [' + tenureType + ' / ' + topYear + ' / ' + totalUnits + '] '
                        + ', ' + bedNum + ', ' + bathNum + ', ' + floorSize + ', ' + price + '	'
                        + agentName + ' ' + phoneNumber
//alert(clipboardText);
  var clipboard = new Clipboard('.btn');
  var title_text = ' <button style="font-size:14px;background-color: #eeeee4" class="btn" data-clipboard-text="' + clipboardText + '">点我复制 url / listing info / agent + phone </button>';
  $("h1").append(title_text);

  // https://api.whatsapp.com/send/?phone=电话号码&text=文本信息&type=phone_number&app_absent=0
  var sendText = 'Hi+' + agentName.replace(/ /g, '+') + '+I+am+interested+in+your+listing+' + url;
  var newDiv = $('<a style="margin-left:10px;" target="_blank" href="https://api.whatsapp.com/send/?phone=' + phoneNumber.replace(/\+|\s+/g, '') + '&text=' + sendText + '"><img src="https://ibit.ly/iTu8B"></img></a>');
  $("h1").append(newDiv);
    setTimeout(() => {}, 2000);

})();