Project 1999

Go Back   Project 1999 > Blue Community > Blue Trading Hub

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #11  
Old 09-22-2012, 10:52 PM
tristantio tristantio is offline
Fire Giant

tristantio's Avatar

Join Date: Nov 2010
Posts: 888
Default

Hi Falkun, thanks for the advice on the item linking. I could probably adjust so hyphens work properly, but I believe the reason I did not initially was that some item names contain them.

Since none (or extremely few) item names contain a comma (,) or slash (/), I was able to assume that was a breaking point in the /auc log.

The regular expressions I'm using for this break apart can be seen in the eqAuction.js file the site uses.

Code:
//Define regexes
var item = new RegExp(/([A-Z][a-z][A-Za-z ':`\-]+?)([^A-Za-z ':`\-])/g);
var add_ = new RegExp(/([a-z])([A-Z])/g);
var sell = new RegExp(/([ ]*?)(Selling|Seller|WTS)([: ]*?)/gi);
var buy = new RegExp(/([ ]*?)(Offering|Buying|WTB)([: ]*?)/gi);
var caps = new RegExp(/( [A-Z][A-Z])/g);
var dash = new RegExp(/[\-\|]+? /g);
var dash2 = new RegExp(/ [\-\|]+?/g);
and applied on the fly as such:
Code:
function findItems(target) {
	target = target ? target : '.aul';
	$(target).each(function() {
		var text = $(this).html();
		text = text.replace(add_, '$1, $2');
		text = text.replace(sell, '$1(WTS)$3');
		text = text.replace(buy, '$1(WTB)$3');
		text = text.replace(caps, ', $1');
		text = text.replace(dash, ', ');
		text = text.replace(dash2, ', ');
		text = text.replace(item, '<a href="http://wiki.project1999.org/index.php/$1" alt="$1" class="ii">$1<pre class="itemTT"></pre></a>$2');
		$(this).html(text);
	});
}
__________________
Realtime auction logger: http://ahungry.com/eqauctions/
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 04:27 PM.


Everquest is a registered trademark of Daybreak Game Company LLC.
Project 1999 is not associated or affiliated in any way with Daybreak Game Company LLC.
Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.