Help with plguin for basket -> forum conversion

Soldato
Joined
1 Apr 2009
Posts
9,950
I'm bored, and jobless atm, so I write a prototype C++ app to convert OcUK viewcart webpage into forum friendly code.

I was wondering if there are some web developer(s) willing to help me write a proper extension to convert the c++ code into something that could be integrated into a browser. I'm not really up to scratch with .net, java, and Chrome Extensions.

* preferably Chrome as it's my main browser, but I don't mind getting dirty with Firefox if needs be.



the code.



an example (completely random items).


YOUR BASKET

HD-048-OC_60.jpg
~ £174.98x(1) ~ OCZ Vertex 2E 120GB 2.5" SATA-II Solid State Hard Drive (OCZSSD2-2VTXE120G)
GX-069-GI_60.jpg
~ £109.99x(1) ~ Gigabyte GeForce GTS 450 OC 1024MB GDDR5 PCI-Express Graphics Card with FREE Mouse Pad
HD-097-SA_60.jpg
~ £68.99x(1) ~ Samsung SpinPoint F4 EcoGreen 2TB SATA-II 32MB Cache - OEM (HD204UI)
FL-004-PA_60.jpg
~ £23.99x(1) ~ Patriot Signature LX series 16GB SDHC Class 10 Flash Card (PSF16GSDHC10)

Total : £389.35(shipping : £9.50).


The idea would be to view the basket, push a button, which would convert the basket into forum code and paste onto the clipboard, and then simply paste the content into a post. Simples! Well, in theory...
 
Last edited:
Code:
var req = new XMLHttpRequest();
req.open("GET", "http://www.overclockers.co.uk/viewcart.php", true);
req.onload = parseResponse;
req.onabort = showAbort;
req.onerror = showError;
req.send(null);

function parseResponse()
{
    alert('success' + req.responseText);
}

function showAbort() 
{
    alert('aborted.');
}

function showError() 
{
    alert('error.');
}

I get responseText, not responseXML from server. hmmm...
 
more tribulations

Code:
 var responseDoc = document.createElement("doc");
 responseDoc.innerHTML = req.responseText;

and I get this in the debugger

Code:
Uncaught TypeError: Object #<an HTMLElement> has no method 'getElementById'

woohoo!
 
well, pushed it as far as I could for today. At least I'm getting some traction, but the DOM file has circular reference, which bugs the reply data conversion :/

"TypeError: Converting circular structure to JSON".

Chrome extension code.

I'll have another look tomorrow. Learning quite a bit, which is good.
 
Would it be nicer to format it like:

YOUR BASKET

1 x Shuttle SG41J1 Plus (Socket 775) DDR3 Barebones - Black - £99.99
2 x Gigabyte GA-P55-USB3 Intel P55 (Socket 1156) DDR3 Motherboard - £99.99

Total: £298.98

??
 
I don't know... I quite like seeing the picture of the gear :) what I can do is add formatting in the options. to enable or disable images and make it more concise. The problem with putting the price at the end is that some item descriptions are huge.
 
At that size you might as well be looking at anything though, and it makes the lines triple height for no perceivable gain. As you say though, give the options :) I definitely wouldn't have the item price before the item name, looks crap. My version looks a lot cleaner :cool: :p
 
Maybe have an option to have the images in a left to right strip at the top and then the items itemised like slylittlefox's style? not as clear as having them down the side as to which is which but it does give you some idea as a quick overview whats what i.e. you can see at a glance if theres a CPU in the list before going down it.
 
Last edited:
Back
Top Bottom