Thursday, March 11, 2010

No API? No Problem! A Data-Entry Robot Comes To Rescue!

One of my client has average one hundred transactions on PayPal per day, I have written a program which takes advantage of PayPal API to improve the shipment process for their warehouse. However, the biggest headache for them is to enter the tracking information into PayPal for each transaction. Ever since PayPal released their first API, the developers have been asking the shipment tracking info API, and even on PayPal web site there is a name for it - AddTrackingInfo. The truth is the API item never existed!

Roughly one month ago, I read the news about a MIT student developed a graphic-based program called sikuli. I didn't pay much attention then, however, I was thinking about it might be a good replacement for the tooling I used on screen scraping and keyboard automation in some applications.

While customer keep asking, and as usual I searched entire PayPal developer site and made sure the tracking API won't be available anytime soon, I have decided to give it a try. The sikuli is a Jython-based language, it can take parameters from file, so what I need is to generate a file from the database with the PayPal transaction ID and the shipping tracking number daily, and a sikuli script file to do the data entry. The sikuli file will emulate the whole PayPal order tracking data entry process.
After two-hour trials and errors, the script finally works like a champ, since I want it to run stable rather than fast, I have added more dealy than usual, it takes around 20 seconds to finish each order update. Now I need is a compiler to make the script a executable file. Thank you sikuli, you saved my life! KowTow __/\__
Above is part of the sikuli script.

1 comment:

  1. Thank you Horace for this great article.
    We have about 100 orders a day from ebay as well and automation of tracking info input has long been desired.
    I just checked out the sikili site and got the basic stuff working. However, I can't seem to find the synax to take parameters from files.
    Can you please kindly tell me where I can find it?
    Thank you,
    Chihyuan Liao (