http://127.0.0.1:8001/cgi-bin/searchprovider.html

Discussion in 'Chickenfoot Scripts' started by Graham, Nov 3, 2006.

  1. Graham

    Graham Developer Staff Member

    Here's a script that brings up the New Zealand zip code and map for a provider ( Firefox icon on the providers page ) on new tabs.
    <pre id="pre">try { number = find(/Number: ([\w\s]+)/).groups[1]; }
    catch(e) {
    number = '';
    }
    try { street = find(/Street: (.*)/).groups[1]; }
    catch(e) {
    street = '';
    }
    try { suburb = find(/Suburb: (.*)/).groups[1]; }
    catch(e) {
    suburb = '';
    }
    try { city = find(/City: (.*)/).groups[1]; }
    catch(e) {
    city = '';
    }

    try { street2 = find(/Number&amp;Street: (.*)/).groups[1]; }
    catch(e) {
    street2 = ''; // this is two single quotes
    }
    try { city2 = find(/City&amp;State: (.*)/).groups[1]; }
    catch(e) {
    city2 = '';
    }

    with(openTab('http://www.nzpost.co.nz/Cultures/en-NZ/OnlineTools/PostCodeFinder/', true)) {
    enter("Number",number)
    enter("Street Name",street)
    enter("Suburb",suburb)
    enter("City",city)
    click("SubmitAddressSearchImageButton")
    }

    with(openTab('http://www.wises.co.nz/Default.aspx/', true)) {
    enter("Street",street2);
    enter("Auckland",city2);
    click("Search");
    }






    </pre>
  2. Graham

    Graham Developer Staff Member

    Here's a previously published script that searches for a USA provider's map on yahoo.com. Note that you should test this first manually on yahoo.com first as it may rely on some cookies sent by yahoo.<pre id="pre">// This chickenscript grabs the address details
    // and brings up the appropriate map in the USA. Change "United States" to "Canada" if you need this.

    try { street = find(/Number&amp;Street: (.*)/).groups[1]; }
    catch(e) {
    street = ''; // this is two single quotes
    }
    try { city = find(/City&amp;State: (.*)/).groups[1]; }
    catch(e) {
    city = '';
    }

    with(openTab('http://maps.yahoo.com/', true)) {
    enter("Address",street);
    enter("City",city);
    pick("United States");
    click("Get Map");
    }
    </pre>
  3. Jason

    Jason Developer / Handyman Staff Member

    Can you do one for Google Maps ?

  4. Graham

    Graham Developer Staff Member

    Never used google maps.

Share This Page