Script to convert currency in eBay auctions

Users can share resources like search engine definitions, dictionary definitons here.

Moderator: SlimBrowser Forum Moderators

Post Reply
SmackoTron
Newbie
Posts: 7
Joined: Tue Jul 15, 2003 9:04 am
Location: Sweden
Contact:

Post by SmackoTron » Fri Aug 27, 2004 8:39 am

I wrote this JavaScript that can be used in SlimBrowser to show the price of an eBay auction in SEK (Swedish kronor).

It could easily be adapted for other currencies.

Code: Select all

// Exchange rate
   rate = 7.655;

// USD
   var match = /US \$([0-9.]*)</m.exec(document.body.innerHTML);

// Not USD
   var match2 = /US \$(.*)\)/m.exec(document.body.innerHTML);

   if (match2 == null) {
     var price = match[1];
   } else {
     var price = match2[1];
   }

   price = price * rate;

   alert("Cirka "+price+" kronor.");
<a href='http://www.johannaost.com' target='_blank'><img src='http://www.johannaost.com/button1.jpg' border='0' alt='user posted image'></a>

Post Reply