Hack 97 Automatic Reciprocal Feedback

figs/expert.giffigs/hack97.gif

Leave automatic feedback for any customer who has left positive feedback for you.

As much as you should respond quickly to any complaints lodged against you in your feedback profile, you'll also want to leave positive reciprocal feedback for each and every positive comment you receive from buyers, as suggested by [Hack #5]. As you might expect, this is also something that can be done with the eBay API.

But let's add a little spice to the mix. Instead of leaving the same feedback comment every time, let's have the script choose a random comment. Start by creating a plain-text file with a handful of positive comments, one on each line:

Lightning-fast payment. Reliable buyer. Thanks for your business!
Quick to pay, friendly emails. This eBayer makes selling a pleasure!
Very fast payment, good communication. All-around excellent customer!

Save the file as prefabpraise.txt and place it in the directory specified in your config.pl file (discussed at the beginning of this chapter).

Next, take the script from [Hack #96] and replace the code between line [5] and line [6] with this code:

    if ($type eq "Praise") {
      open (INFILE,"$localdir/prefabpraise.txt");
        @line = <INFILE>;
      close (INFILE);
      chomp @line;
      $lines = @line;
      $choice = int rand ($lines);
      
      system './leavefeedback.pl', $item, $from, 'positive', $choice;
    }

Or, if you want a single script to leave positive reciprocal feedback and notify you of negative feedback, just place this code before line [5].

Note that this script requires the leavefeedback.pl script from [Hack #95].