Forum Replies Created

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter paulmm2125

    (@paulmm2125)

    Thanks, it’s working great now, much appreciated! Looking forward to some more great features in the future.

    Thread Starter paulmm2125

    (@paulmm2125)

    It is ignoring the first part of the google list now, but still pulling a list that might be at the end of the blurb. Example text:

    5 star review Extremely pleased! We found it very easy to communicate with Nik painting. They were very professional and went above and beyond to accommodate our needs. We will definitely use Nik painting again and would highly recommend their services. Excellent and prompt service.Services: Interior painting , Repair drywall , Paint doors

    Also, could there be an option to pull the data with those lists and without? Much appreciated!

    • This reply was modified 4 years, 4 months ago by paulmm2125.
    Thread Starter paulmm2125

    (@paulmm2125)

    I think just the main body is good, doesn’t really seem to be a need for those extra lists.

    Thread Starter paulmm2125

    (@paulmm2125)

    PID = ChIJddSKvqfR1IkRF-xo8mJamuY

    I wrote a script last night to format the text the way I wanted, but some more control would definitely be amazing. Here is the script I’m applying to get it to look like it does in Google:

    $('.wprevpro_t1_P_3').each(function() {
    	var cache = $(this).children();
    	var text = $(this).clone().children().remove().end().html();
    	var arr = text.split(' ');
    	if (arr.length > 1) {
    		for (var i = 0; i < arr.length; i++) {									
    			if (arr[i].substr(arr[i].length - 1) == ':') {
    				//first list
    				if (i == 0) {
    					arr[i] = '<strong>' + arr[i] + '</strong> ';
    					continue;
    				}
    				//other list
    				var index = [];
    				index.push(arr[i].lastIndexOf('.'));
    				index.push(arr[i].lastIndexOf('!'));
    				index.push(arr[i].lastIndexOf('?'));
    				index.push(arr[i].lastIndexOf(' '));						
    				var max = Math.max(...index);
    				if (max == -1) continue;						
    				arr[i] = arr[i].substring(0, max + 1) + '<br><br><strong>' + arr[i].substring(max + 1) + '</strong> ';
    				arr[i] = arr[i].replace('   ', '<br><br>');
    				//console.log('Length: ' + arr[i].length + '\nMax: ' + max + '\nIndex: ' + index.indexOf(max));
    			}
    		}
    		$(this).html(arr.join("")
    					 .replaceAll(' ,  ', ', ')
    					 .replaceAll(' ,', ', ')
    					 .replaceAll('   ', '<br><br>')
    					)
    			//.prepend('<br>')
    			.prepend(cache);
    	}
    });
Viewing 4 replies - 1 through 4 (of 4 total)