Skip to Main Content
eBay Hacks
book

eBay Hacks

by David A. Karp
August 2003
Beginner content levelBeginner
368 pages
9h 38m
English
O'Reilly Media, Inc.
Content preview from eBay Hacks

Negative Feedback Notification

Have a script notify you whenever you’ve received negative feedback.

Given the importance of feedback, especially to sellers, it’s a good idea to routinely check your feedback profile for complaints or comments that should be addressed, as discussed in [Hack #4]. But doing this every day, especially for sellers who receive dozens or even hundreds of feedback comments every week, can be a chore.

This script routinely scans your feedback profile and notifies you of any new negative or neutral feedback you’ve received.

#!/usr/bin/perl
require 'ebay.pl';

$localfile = "feedbackalert.txt";
%roles = ('S', 'seller', 'B', 'buyer');

my $rsp = call_api({ Verb => 'GetFeedback',     [1]
              DetailLevel => 1,
                   UserId => $user_id,
                   SiteId => $site_id,
             StartingPage => $page_number,
             ItemsPerPage => 1
});
$totalcomments = $rsp->{Feedback}{FeedbackDetailItemTotal};

$oldtotal = 0;
if (-e "$localdir/$localfile") {
  open (INFILE,"$localdir/$localfile");
    $oldtotal = <INFILE>;     [2]
  close (INFILE);
}

$newcomments = $totalcomments - $oldtotal;     [3]
if ($newcomments == 0) { exit; }

if ($newcomments > 200) {
  $num_pages = int($newcomments / 200) + 1;
  $page_size = 200;
} else {
  $num_pages = 1;
  $page_size = $newcomments;
}

PAGE:
for (my $page_number = 1; $page_number <= $num_pages; $page_number++) {
  my $rsp = call_api({ Verb => 'GetFeedback',     [4] DetailLevel => 1, UserId => $user_id, SiteId => $site_id, StartingPage => $page_number, ItemsPerPage => $page_size }); if ($rsp->{Errors}) { print_error($rsp); ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

eBay Hacks, 2nd Edition

eBay Hacks, 2nd Edition

David A. Karp

Publisher Resources

ISBN: 0596005644Catalog PageErrata