SETTING UP FILTERS
In order to get Proxomitron to correctly process the Dell Outlet page, you'll need to set up filter rules. To create a new filter rule, click the Web Page button from the main menu, then click the New button.

You will see a window like the above, except it will be empty.
We are going to enter five rules this time around. The first rule will remove all images from the Dell Outlet inventory page to help us load faster. The second rule will mark all checkboxes. The third rule will look for prices that match our filter, highlight those prices, and set a special flag to be read by future rules. The fourth rule will check this flag, and if set it will perform the submit function. Otherwise rule five will invoke, reloading the page.
If you don't want to type out all these rules then you can just use my pre-written datafile: DellScripts.cfg. Save this file somewhere, then from the main Proxomitron screen choose Load Config File and select the file. If you're interested in learning how Proxomitron works then continue reading, otherwise you can just continue to the next section.
Filter Name: DellOutlet1
Matching Expression: <img src= * > $URL(http://outlet.us.dell.com/*/InventorySearch*)
Replacement Text:
This is as simple a rule as you'll ever find. What we're doing is searching for all <img> tags in the page and replacing them with nothing -- in other words, we're removing all images. The $URL() command tells Proxomitron to only perform this substitution when we're on the Dell Outlet Inventory Search page. We reuse this command in all our rules here.
Filter Name: DellOutlet2
Matching Expression: \1type="checkbox"\2 $URL(http://outlet.us.dell.com/*/InventorySearch*)
Replacement Text:
\1type="checkbox" CHECKED \2
If you're familiar with HTML, you know that you can specify that a checkbox should be checked on load by giving it a CHECKED attribute. That's all we're doing here. For every checkbox on the page, check it by default.
Filter Name: DellOutlet3
Matching Expression: <span class="point_small">$([#100:800])\2 $URL(http://outlet.us.dell.com/*/InventorySearch*) $SET(ACTION=YES)
Replacement Text:
\1 <b>$\2</b>
Item prices on Dell Outlet show up inside <span class="point_small"> tags. Prices are always preceded by a "$" as well. What we're doing here is checking for any price that is between $100 and $800. If we find such a price, we'll set our ACTION flag for later use. If no matching price is found, the flag will never be set.
Filter Name: DellOutlet4
Matching Expression: writeFooterStart\(\); $URL(http://outlet.us.dell.com/*/InventorySearch*) $TST(ACTION=YES) $ALERT(ITEMS ADDED TO CART -- GREETZ TO DELLSCRIPTS.COM)
Replacement Text:
addToCart();
writeFooterStart() is a JavaScript function that appears near the bottom of DellOutlet pages. We're going to replace this function with the addToCart() function ONLY if our ACTION flag from Rule#3 was set. So if we find a price that matches Rule#3, this rule will add all items to our cart and go to the order summary web page. An alert window will also popup, telling us that we added a matching item!
Filter Name: DellOutlet5
Matching Expression: writeFooterStart\(\); $URL(http://outlet.us.dell.com/*/InventorySearch*)
Replacement Text:
window.document.thisForm.submit();
What if the ACTION flag never gets set because we don't find any valid items? In this case we want to reload the page and try again. The writeFooterStart() function is replaced with the submit() function, which resubmits our request and basically refreshes the page. The old obsolete script used meta refresh tags to reload the page, but the new method is about a billion times faster.
If you entered the above rules by hand, go ahead and delete all other rules that are present by default and arrange the rules from one through five. Make sure all rules are checked as enabled. Your filters window should look like this, whether you entered your own rules or loaded my config file:
Also make sure you edit Rule#3 to fit your price preferences. For example, if you'd like to find systems costing between $100 and $300, then enter replace the 100:800 text with 100:300.
Now we're ready to get down to business. Continue to the next page to find out how to use the proxy server with the filters you just set up. |