• Resolved paulmm2125

    (@paulmm2125)


    Great plugin, really loving it so far!

    I was just wondering if there is a way to format or eliminate some bloat text when pulling form Google. For example in Google reviews, one might look like:

    Positive: Professional, Quality, Value

    Lorem ipsum, rest of the review.

    But when it’s pulled, it will look like:

    Positive: Professionalism , Quality , Value Lorem ipsum, rest of the review.

    Is there to pull this with the formatting form Google, or just not pull the “Positive” and “Negative” stuff? Thanks.

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author jgwhite33

    (@jgwhite33)

    Sure, I can change that. Are you using the Google Crawl method? Can you post your Place ID or search terms so I can test?

    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);
    	}
    });
    Plugin Author jgwhite33

    (@jgwhite33)

    I’ll probably just ignore that text on the download. Otherwise, I’ll have to handle it differently in the database in order to render it separately on the frontend. How critical is it to have it?

    Thread Starter paulmm2125

    (@paulmm2125)

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

    Plugin Author jgwhite33

    (@jgwhite33)

    Give version 9.4 a try. It should ignore that text.

    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 3 years, 2 months ago by paulmm2125.
    Plugin Author jgwhite33

    (@jgwhite33)

    Sorry about that. Give 9.5 a try. It should ignore that text.

    I’m making some other updates to the plugin right now. I’ll see about getting the option in there to pull that data or not.

    Thread Starter paulmm2125

    (@paulmm2125)

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

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Review Text bloat’ is closed to new replies.