"Borrowing" the CustomInk.com Vector Library

by GantMan

If you've never used CustomInk.com, you're missing out on one of the coolest online shirt design companies of the past half decade.

If you want to see what I'm talking about, go to CustomInk.com, click the tab at the top that says "The Lab", and then click on the left side to add art.  You may notice that they have over 10,000 images you can add to your shirt, and they are scalable vector EPS files that are dynamically loaded.  The web is filled with people selling "vector packs" of basically scalable clipart that you can buy, but when you apply that math to number of clipart images CustomInk.com has, it's hard not to be wowed by the cost of such a library.

Evil cogs start a-turnin'.

If this is dynamically loading the EPS files into Flash for the shirt designer... shouldn't I be able to get some of those EPS files for my own personal needs?  Wouldn't it be nice to have the entire 10,000+ vector library for your own designs outside of the shirts?  Or just for making a nice torrent for all your friends?

I was on Windows, so I began the adventure by loading up Fiddler (www.fiddlertool.com/fiddler) and watching the HTTP requests.  (Side note: I love Wireshark, but Fiddler is just better because it only listens to Internet Explorer.  This allows you to have all your fun apps running, and even still browse the web in Firefox etc., without mucking up your packet captures.  For anything that's not web related I load up Wireshark... and turn off just about every other application I have running, because I suck at Wireshark filters.)

Now that Fiddler was listening to IE, I pulled up the library from CustomInk.  As the system loaded the images, it was pulling GIFs from */clipart/gif/*.

So for example, one GIF was from: */clipart/gif/64772.EPS.gif*

If you look at this path, it's easy to notice it's got a GIF directory, and the GIF already has the EPS name.  A simple, quick guess was that the EPS was in an /eps/ directory with the normal EPS extension.  Using the above GIF I generated the following guess and slammed it in the browser: www.customink.com/clipart/eps/64772.EPS

BOOYA!  It gave me a download of a EPS file.

I opened it to find the delicious vector representation of the GIF I was just ogling.  I typed in a few more, just to be sure, and everything came back perfect.  So, one process I have is to go around and view all the GIFs and capture them all in Fiddler, press Ctrl+U to copy the URLs, do find and replace and pull down all those EPS files.

But the file names are sequential... so I can simply generate a list of URLs without any effort at all!

So now I needed to generate a bunch of sequential URLs.

From my browsing, the EPS files went from 10000.EPS to < 80000.EPS.

Building a sequential text file would be easy.  I chose to generate a quick VBScript, since I was on a Windows machine at the time.  I created a VBS file on the desktop and inserted the code below:

Set fs = CreateObject("Scripting.FileSystemObject")
Set a = fs.CreateTextFile("ALLEPS.txt", True)
For xcount = 10000 TO 80000
     a.WriteLine("http://www.customink.com/clipart/eps/" & xcount & ".EPS")
Next
a.Close
msgbox "Dun"

Running this VBScript file will put a file in the same directory, called ALLEPS.txt, with a bunch of generated URLs that should download CustomInk's EPS library.

Most of you know what to do with such a file, but, for the rest, you should download an application called GNU Wget for Windows (gnuwin32.sourceforge.net/packages/wget.htm).

GNU Wget is an app that comes from our UNIX friends, to "get" files from the web.  Once I installed GNU Wget on the Windoze computer I was using, I ran the following command with a copy of the ALLEPS.txt file in the same directory:

$ wget --input-file=ALLEPS.txt --tries=2 --retry-connrefused -nc --waitretry=1 -v

This basically says, "Gimme all the URLs from the file, try twice at most, and give it a second between each failed attempt."

After running the command and seeing file after file get pulled happily into my folder, I went to sleep.  I awoke the following morning with the entire library.

This isn't very nice to the CustomInk.com servers (about 10 GB of vector files), so if you decide to design any shirts in the near future, please use their service so that they can pay their bills.

Code: customink.vbs

Return to $2600 Index