Perl script monitors payments and feedback in eBay sales

Watchful Seller

Article from Issue 188/2016
Author(s):

We show how to use a screen-scraper and an application for the official eBay API to trigger an alarm on incoming eBay customer feedback and detect errors in the monthly billing statement.

If I ever get around to writing my memoirs, I am going to include a lengthy chapter about my life's motto, which is: "Anything you don't constantly monitor is guaranteed to go belly up when you least expect it." True to this motto, I wrote a script this month to receive an email immediately when one of my eBay customers has left feedback about a transaction.

Simply Scraping

As a quick and dirty solution, and to first avoid having to register as a developer with eBay, I wrote a screen-scraper that extracts the current feedback score from the slew of HTML on the feedback page, before saving the counter and raising the alarm during subsequent runs if the value has increased.

When I click on my username on eBay.com, the browser lands on the feedback page in Figure 1. Selecting view-source in the browser shows the HTML code from Figure 2, and a text search for the string 362 (the current feedback score) shows that this number is found in a markup tag of the mbg-l class:

[...]

Use Express-Checkout link below to read the full article (PDF).

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy Linux Magazine

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

  • e-Commerce APIs

    Thriving online stores are rare and the result of hard work. If you are just beginning to peddle your wares, you might be better off building a custom interface to sell your goods on eBay or Amazon.

  • Workspace: BambooInvoice

    If you want your business to run smoothly, deploying a dependable invoicing solution should be among your top priorities. BambooInvoice offers a user-friendly, web-based invoicing solution.

  • Perl: Google Drive

    Armed with a Chinese guillotine and a scanner with an automatic document feeder, Mike Schilli gives his books some special treatment, courtesy of Google Drive, which offers 5GB of storage space – room enough to start an online PDF collection.

  • Free Software Projects

    Free software covers such a diverse range of utilities, applications, and projects, that it can be hard to find the perfect tool. We pick the best of the bunch. This month we examine Bluefish, Bidwatcher, KWappen, Capi4BSD, and current events at the Debian project.

  • Determining assets across a shrinking number of financial APIs

    Financial wizard Mike Schilli is annoyed that some web services have discontinued serving up real-time stock market data. To keep an eye on his investment dollars, Mike taps into a little known interface for stock prices.

comments powered by Disqus
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters

Support Our Work

Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.

Learn More

News