Shoestring Theory

Currently documenting the house that is eating our lives, we will return to regularly scheduled programming in a couple of more months

Shoestring Theory header image 2

Automatically revise eBay listings to remove email addresses and links (and many other things!)

September 11, 2011 at 1:26 pm by thetheorist

With eBay’s upcoming mandatory ban on certain contact information and links in listings, particularly email addresses, we’ve been faced with a Sisyphean task: Manually revising well over 2000 listings to remove multiple email addresses and “contact us” links from them. There are at least 2 revisions to be made for every single listing.

Optimistically, I think I could do about 500 listings a day manually. That would take at least 5 days of work, and replace the time that I would normally be listing new merchandise. It’s been a dark, foreboding cloud hanging over me since eBay announced this. I could spread it out over time, but the odds of me missing a bunch of listings seems much higher doing it that way.

A couple of days ago it occurred to me that there might be tools available, or that I could create, to automate this task. After about a full day of searching for Firefox addons, testing them, and writing a little bit of my own Javascript, I’ve finally fully automated the task of revising my eBay listings. All these tools are currently aimed at stripping out those email addresses, but in the future they will let me due bulk edits to my listings, a huge boon.

I want to emphasize that I am not a professional coder or web designer. Just an eBay seller who needed a tool and cribbed one together from multiple pieces. This worked for me, but I cannot promise that it will work flawlessly for you. Each of these tools may require you to do additional reading to educate yourself about their fine points. A couple of them are powerful, robust tools that can do much more than what I’ve listed. Any problems created for your business, computer or life are your responsibility. I’ve provided this guide to help, but at the end of the day you are responsible for your own actions and the actions you take with this information.

Without further ado, here is the guide to automate revising your eBay listings:

This collection of tools will auto-click through all of the pages of revising an eBay item, automatically revise any text in your description that needs changed and allow you to do this to dozens of listings at a time. This has been tested and worked terrifically in Firefox 5 and Firefox 6.0.2. Your mileage may vary with other versions of FF. Based on my research, similar results should be able to be achieved in Chrome. There may also be other addons that I missed that are more efficient than these.

To set all this up will probably take less than hour, including testing.

You will want to download and install the following addons to Firefox (I’m listing the revision numbers as they were when I used them) and the developer’s description is in quotes:

FoxReplace 0.12.2 – “Lets you replace text in web pages. You can define a substitution list and apply it automatically or at your own discretion, or make individual substitutions. You can use this as a filter, or just for fun :)”

Greasemonkey 0.9.11 – “Customize the way a web page displays or behaves, by using small bits of JavaScript.”

Snap Links Plus 2.1Currently beta/experimental, but seemed to work great – “Select a number of links with a rectangle and open them all in new tabs or do other things with the links.”

Web Developer 1.1.9 (optional, but could be useful) – “The Web Developer extension adds various web developer tools to a browser.”

Once those are installed and you’ve restarted Firefox, you’re ready to start setting everything up.

First, FoxReplace. It can manually or automatically find and replace text in web forms. It is a global replacement, there is no option to choose. You will define a find criteria, and then define a replace criteria. You can specify this to be applied to every web page, or only specific web pages.

To access these options, in Firefox click on Tools -> FoxReplace -> FoxReplace Options…

A new window will appear that will let you set these criteria. Here is an example of what mine looked like (with my actual business email replaced) (click on the image to see it full size, it’s too wide to fit on the blog):

Screenshot of FoxReplace

In the Replace field, you will need to enter exactly the text that you want to replace. This will be dependent on how you have formatted your listings, so I can’t tell you what to put there. The same is true of the With field. I chose to just replace the link with a generic “contact us”. You may want something else.

Once you’ve entered your find and replace criteria, you’ll want to check the Replace URLs box on the main options page. Don’t check the Auto-replace box for now. While filling out your criteria, also do not check the box for HTML. I found that with that option on, it wouldn’t work with the eBay forms.

You may also notice that if you hit F2 it will manually do a search and replace. If you hit Shift+F2, it brings up a toolbar that lets you do manual replacements with on the fly definitions. I found that neither of the manual options would work with eBay, but the “Auto-replace on page load” worked perfectly. Since this is the option we want for automating the process, the addon works for this purpose.

The address I have entered into the URL field is the core address that appears when you are revising listings. The stars before and after it are wildcards, so it will work no matter what other gibberish precedes or follows it.

I suggest at this point checking and making sure that the addon is working for you. Once you have defined your criteria, turn on the auto-replace feature (it can be toggled on and off from the Firefox Tools menu). Now click Revise on one of your listings and see if it correctly replaces the text. It may take a little adjusting to get it working correctly.

Added Bonus! If you have to relist or sell similar on a lot of listings over the next month or two, you can just leave FoxReplace turned on all the time while listing, and it will automatically make the changes, so there’s no chance you will forget while relising old merchandise that wasn’t up when you did your bulk changes!

Next, it’s time to learn about Greasemonkey, one of the most awesome and powerful tools for Firefox. It lets you run your own Javascript on top of web pages. You install them in Greasemonkey, and it then executes them when the criteria are met. Even if you don’t have any working knowledge of Javascript, you should still be okay. The scripts I have written should work for any eBay listing that is being revised.

Originally I wrote 3 scripts, mostly because I was testing each action individually. However I’ve combined them into a single script for the final process. They could be split back up into the component parts if you just wanted to open the revision page, but not click the rest of the way through. If people have some interest in this, I can split it back up and post it on userscripts.

First, the script clicks the Revise link on an active eBay listing. Then it clicks the Continue button on the next page. This part has a 5 second delay built into it, to make sure that FoxReplace has time to do its job. With no delay, it wasn’t working. I settled on 5 seconds to be safe, but it may be that it could be shorted to 2-4 seconds. The final action clicks the submit button on the confirmation page.

This is the full code if you want to install it manually:

// ==UserScript==
// @name Automate eBay Revisions
// @namespace eBay Revision Tool
// @description Automatically click through the eBay revise item screens
// @include http://cgi5.ebay.com/*
// @include http://cgi.ebay.com/ws/*
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js
// ==/UserScript==

window.addEventListener (“load”, LocalMain, false);

function LocalMain ()
{

var TargetLink = $(“a:contains(‘Revise your item’)”)

if (TargetLink && TargetLink.length)
window.location.href = TargetLink[0].href

window.setTimeout(function() {document.evaluate(“//button[@name=’aidZ1′]”, document, null,

9, null).singleNodeValue.click();}, 5000);

document.evaluate(“//button[@name=’aidZ126′]”, document, null, 9,

null).singleNodeValue.click();

}

If you just want to click a button to install the script, it is hosted on userscripts.org and can be downloaded here. Just follow that link and then click the green Install button in the upper right (Greasemonkey will need to be installed).

Now, check to make sure that Greasemonkey is working properly by itself before actually using FoxReplace. So turn off FoxReplace (through the Tools menu). Now turn On Greasemonkey. A little Monkey icon should now be on the far right of your address bar. When it’s greyed out, it’s off. When it’s lit up, it’s on. You can also enable and disable Greasemonkey through the Firefox Tools menu.

With Greasemonkey on, open up one of your listings while signed into eBay. Over the course of about 7-10 seconds, it should go from the listing, to the revision page, to the submit page and finally the the Successfully Revised page. If everything worked as it should, then you’re almost ready to start batch processing your listings. The heavy lifting is done.

Snap Links Plus does not require any configuration. It simply lets you click your right mouse button, and then drag a green rectangle over a bunch of links. When you release the mouse button, all those links will open in new tabs. I suggest testing this with both Greasemonkey and FoxReplace turned off. This will let you open up an entire page of item links from My eBay or Selling Manager.

The final tool I’ve listed is Web Developer. This is optional, but I used it to speed up the process. It adds another toolbar to Firefox and lets you control how Firefox renders things. I used it to turn off Images. To turn off Image loading, click on Options -> Persist Features. Then click on Images -> Disable Images -> All Images. Now images will no longer load. On a very fast internet connection, this may not matter much, but on a slower connection, it will shave some time off and lower some load on Firefox once you start bulk revising.

For the last time, I’m going to re-iterate that if anything goes wrong, breaks, ruins your business, makes your computer explode or dog go bald, it’s not my fault. I’ve simply provided this guide as a how-to for you to try this yourself. Anything you do with this information is your responsibility.

Okay, assuming everything has worked, you’re ready to test it all together. Turn on FoxReplace and Greasemonkey. Now open up one of your listings. Let the process go. Once it has finished, turn off Greasemonkey and check the listing. The information you wanted changed should now be changed and saved. Hooray!

At this point, I tested everything for awhile before going whole-hog on it. I tested 5 at one time, then 10 at one time, then 25, then 50 and finally 100 listings at a shot. 100 brought my computer and Firefox to their knees. It was not a good idea, and I seriously thought the whole thing was going to crash about halfway through. However, 25 and 50 both processed fine and I’ve been revising my listings in batches of 50.

If you have any questions, please let me know in the comments and I’ll do my best to answer them. As I said though, I’m not a professional programer or web designer.

Also, stay tuned in the next few days and I’ll be posting a couple of more tricks I figured out related to PayPal and automating printing invoices.

Tags:   · · · · · · 1 Comment - Follow the string

Leave A Comment

The Submit button may not be appearing or working correctly in IE6. I would suggest upgrading to IE7 or Firefox 2 for full functionality (I'm still looking for a solution to this if anyone knows one).

1 response so far ↓