Hi all,

Couldn't figure out how to get the existing eBay search to switch to UK side, 
so did a conversion. It's useful primarily because it allows people in the UK 
to use the /my switch and get their myEbay page auctions in £GBP and times in 
BST/GMT by default.

Dave.
<search function="ebayuk">
  <name>eBay UK</name>
  <description>
    Search eBay.co.uk by description or by item number.<br/>
    <div class="helpboxDescLabels">Switches:</div>
    <table class="helpboxDescTable">
      <tr><td>/about</td><td> - </td><td>View username's About Me page</td></tr>
      <tr><td>/all</td><td> - </td><td>Search auctions by username including completed</td></tr>
      <tr><td>/feedback</td><td> - </td><td>Display feedback on an ebay user</td></tr>
      <tr><td>/items</td><td> - </td><td>Search items by username</td></tr>
      <tr><td>/my</td><td> - </td><td>Open MyEbay page</td></tr>
      <tr><td>/user</td><td> - </td><td>Search current auctions by username</td></tr>
    </table>
    <div class="helpboxDescLabels">Examples:</div>
    <table class="helpboxDescTable">
      <tr><td>ebayuk guitars</td></tr>
      <tr><td>ebayuk 1503826268</td></tr>
      <tr><td>ebayuk /ab music-brokers</td></tr>
      <tr><td>ebayuk /all mickey</td></tr>
      <tr><td>ebayuk /f mickey</td></tr>
      <tr><td>ebayuk /i music-brokers</td></tr>
      <tr><td>ebayuk /my</td></tr>
      <tr><td>ebayuk /u mickey</td></tr>
  	</table>
  </description>
  <category>Shopping</category>
  <link>http://www.ebay.co.uk/</link>
  <contributor>Ryan Edwards, Darrick, Brent Beardsley, David Golding</contributor>
  
  <form name="ebayukf"
        action="http://search.ebay.co.uk/search/search.dll";
        method="get">
    <input type="hidden" name="MfcISAPICommand" value="GetResult"/>
    <input type="hidden" name="ht" value="1"/>
    <input type="hidden" name="SortProperty" value="MetaEndSort"/>
    <input type="hidden" name="query"/>
  </form>
  
  <script><![CDATA[
    function ebayuk(q)
    {
      if( nullArgs("ebayuk",q) )
        return false;

      var args = parseArgs(q, "all, about, feedback, items, my, user");

      if (args.switches.length > 0) {
        switch (args.switches[0].name)
        {
        case "about": openSearchWindow('http://members.ebay.co.uk/aboutme/' + args.q +'/'); return false;
        case "all": openSearchWindow('http://cgi.ebay.co.uk/aw-cgi/eBayISAPI.dll?' +
                                     'MfcISAPICommand=ViewBidItems&userid=' + args.q +
                                     '&completed=1&sort=3&all=1&rows=25'); return false;
        case "feedback": openSearchWindow('http://cgi.ebay.co.uk/aw-cgi/eBayISAPI.dll?ViewFeedback&userid=' + args.q); return false;
        case "items": openSearchWindow('http://cgi.ebay.co.uk/ws/eBayISAPI.dll?ViewSellersOtherItems&userid=' + args.q + 
                                       '&include=0&since=-1&sort=3&rows=25'); return false;
        case "my": openSearchWindow('http://cgi.ebay.co.uk/aw-cgi/eBayISAPI.dll?MyEbayLogin'); return false;
        case "user": openSearchWindow('http://cgi.ebay.co.uk/aw-cgi/eBayISAPI.dll?' +
                                      'MfcISAPICommand=ViewBidItems&userid=' + args.q +
                                      '&completed=0&sort=3&all=1&rows=25'); return false;
        }
      }

      var res = null;
      if ( res = args.q.match( /^\s*(\d{9,})\s*$/ ) )
      {
        openSearchWindow('http://cgi.ebay.co.uk/aw-cgi/eBayISAPI.dll?MfcISAPICommand=ViewItem&item=' + res[1]);
      }
      else
      {
        document.ebayukf.query.value = args.q;
        submitForm(ebayukf);
      }
    }
  ]]></script>

  <copyright>
	Copyright (c) 2002 David Bau
	Distributed under the terms of the
	GNU Public License, Version 2 (http://www.gnu.org/copyleft/gpl.txt)
  </copyright>
</search>

Reply via email to