O'Reilly logo

eBay Hacks, 2nd Edition by David A. Karp

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Hack #116. Spellcheck All Your Listings

Implement passive, configurable spellchecking to create correctly-spelled listings in less time.

The success of any auction is largely due to how readily it can be found in eBay searches. As described in Chapter 2, eBay searches show only exact matches (with very few exceptions), which means, among other things, that spelling most definitely counts.

Turbo Lister and eBay's Sell Your Item form have spellcheck features, both of which use the old-school, manual approach that forces you to interrupt your work to review each individual mistake. This hack streamlines the process by summarizing the spelling errors in all your listings in one place.

The following script requires the following modules and programs:

Table 8-2. 

Module/program name

Available at

HTML::FormatText (by Sean M. Burke)

search.cpan.org/perldoc?HTML::FormatText

HTML::TreeBuilder (by Sean M. Burke)

search.cpan.org/perldoc?HTML::TreeBuilder

HTML::Entities (by Gisle Aas)

search.cpan.org/perldoc?HTML::Entities

Lingua::Ispell (by John Porter)

search.cpan.org/perldoc?Lingua::Ispell

ispell program (by Geoff Kuenning)

fmg-www.cs.ucla.edu/geoff/ispell.html

Here's the script:

 #!/usr/bin/perl require 'ebay.pl'; require HTML::TreeBuilder; require HTML::FormatText; use Lingua::Ispell qw( spellcheck ); Lingua::Ispell::allow_compounds(1); $out1 = ""; $outall = ""; $numchecked = 0; $numfound = 0; $today = &formatdate(time); $yesterday = &formatdate(time - 86400); my $page_number = 1; PAGE: while (1) { ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required