Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Basket to Post script

  • 19-06-2011 8:31pm
    #1
    Registered Users, Registered Users 2 Posts: 1,414 ✭✭✭


    New version as of 28/3/12 - Sol

    Hey,

    I know there is a few of you more knowledgeable people here that regularly go to sites like HWVS and scan and build a computer for someone by putting the items into your basket and then at the end take a screen shot of it or spend your valuable time converting that basket into a nice bb-coded post for the user that made the request.

    So I thought maybe I could make it a little easier for you :) I don't know has someone done this before, or if you all, already have your own tools for this kind of thing, but I'm gonna post it in the off chance it might help someone.
    I wrote a JavaScript that takes all the items from your basket and puts them into bb-codes so you can just copy and paste the text into your post in these forums. It should hopefully save people time when building a machine for a user.

    Here is the script.
    [PHP]JavaScript:var debug = false;function loadScript( url ){if ( document.getElementById("basket_parser") == null ){var script = document.createElement( "script" );script.setAttribute( "id", "basket_parser" );script.setAttribute( "type", "text/javascript" );script.setAttribute( "src", url + "?" + Math.random() * 10000000 );document.getElementsByTagName( "head" )[0].appendChild( script );setTimeout( "loadScript('" + url + "')", 200 );log( "Started loading script: " + url );}else if ( typeof( init_script ) != 'undefined' ){log( "Loaded." );init_script();}else{setTimeout( "loadScript('" + url + "')", 200 );log( "loading ..." );}}function log (string){if ( debug ){document.body.appendChild( document.createTextNode( string ) );document.body.appendChild( document.createElement( "br" ) );}}loadScript( "http://fluffy88.com/scripts/basket_parser.js" );void( 0 );[/PHP]
    I hope this will come in helpful to all the users of this forum, masters and noobs alike.
    At the moment it only works with
    http://hardwareversand.de/
    http://www.scan.co.uk/
    http://www.dabs.ie/
    http://www.memoryc.com/
    http://www.newegg.com/
    http://www.amazon.co.uk
    http://www.overclockers.co.uk
    but if people find it useful I will extend it for use with any other website that is requested.
    Sites I plan to add to the above list (at some stage),
    http://www.komplett.ie/

    And any ideas on how to make the script better are appreciated.

    To use this script you will have to create a bookmark for the script,
    This varys from browser to browser, so I am just going to cover firefox 10.x now, if needed I can do others by request.
    1. Create a new bookmark
      1. I recommend using the bookmark bar
      2. Right click on the bookmark bar
      3. Select "New Bookmark..."
      4. In the popup window paste the script into the "Location:" section.
      5. Give the bookmark any relevant name perhaps, "Basket parser"
      6. Click "Add"
    2. When you have the script as a bookmark
    3. Visit the site you want to use the script on
    4. Then click the bookmark to run it.

    Sorry I am very poor at explaining things, but if people want to use this and need help just ask, I will do guides with screen shots if it would be simpler to follow.



    Now for the complicated bits
    From here on I am going to try and explain the more advanced/complicated features of this script. For most uses the script posted above will work perfectly and you will have no need to read the below section to use the script. If you however want to change the formatting of the script to suit your own personal style or to adhere to some other format for use on another forum/site then read on.

    Script with editable formatting options.
    [php]JavaScript:var before = 'Item|Price';var format = '{itm_quantity}{itm_name}|{itm_price}';var after = 'Shipping|{shipping}\nTotal|{total}';function loadScript(url) {if (document.getElementById("basket_parser") == null) {var script = document.createElement("script");script.setAttribute("id", "basket_parser");script.setAttribute("type", "text/javascript");script.setAttribute("src", url + "?" + Math.pow(new Date().getMonth(), 2) + Math.pow(new Date().getDate(), 3));document.getElementsByTagName("head")[0].appendChild(script);setTimeout("loadScript('" + url + "')", 200);} else if (typeof(init_script) != 'undefined') {init_script();} else {setTimeout("loadScript('" + url + "')", 200);}}loadScript("http://fluffy88.com/scripts/basket_parser.js");void(0);[/php]
    In this script you will see three variables at the beginning(just after "JavaScript:") called before, format and after this is what you use to edit the format of the output. It uses 'tags' that get swapped with the information(price, name ...) of the items in your basket.

    First I will explain the main format variable.
    Atm there is 4 tags,
    1. {itm_url} - This will get replaced by the full url of the item. Example: http://www.scan.co.uk/products/corsair-600t-graphite-series-black-mid-tower-gaming-case-w-o-psu
    2. {itm_name} - This will get replaced by the full name of the item that is displayed in the basket. Example: Intel Core i5-2500K Box, LGA1155
    3. {itm_price} - This will get replaced by the price of the item that is displayed in the basket. Example: €44.09, £172.94
    4. {itm_quantity} - This will get replaced by the quantity of the item that is displayed in the basket if it is greater than 1. Example: 2 x , 5 x. It might be helpful to note, {itm_quantity} gets replaced with a trailing space, "2 x "
    To change how the output is formatted all we have to do is change this variable and place the 'tags' in between what ever text is needed for your post.
    Some example formats are
    [PHP]var format = '{itm_quantity}{itm_name} {itm_price}';[/PHP]
    A HTML version of this would be
    [PHP]var format = '{itm_quantity}<a href="{itm_url}">{itm_name}</a> {itm_price}';[/PHP]
    A tabled version
    [PHP]var format = '{itm_quantity}|{itm_name}|{itm_price}';[/PHP]

    Tags can be placed anywhere in the string.
    You can have as much text around the tags as needed and it will remain untouched.
    Be careful not to remove the single quotes around the format variable as the script will not work without these
    If you want to use a single quote in the format you must backslash it. For example var format='Fluffy\'s basket {itm_price}';
    If you wish to put a line break in the format place a backslash n '\n' in the variable and it will be replaced by a line break.


    Next is the two variables that place text before and after the main body of the basket items.
    There is two 'tags' that will only work in these two variables
    {total} and {shipping}
    These only get replaced in the before and after variables and not the format variable.

    By default if you don't have any of these variables in your script it will use a tabled format that works well here on boards, this is what the default three variables look like
    [PHP]var before = "Item|Price";
    var format = '{itm_quantity}{itm_name}|{itm_price}';
    var after = "Shipping|{shipping}\nTotal|{total}";[/PHP]

    For those interested
    Link to uncompressed JavaScript code

    =========================================================


«13

Comments

  • Moderators, Computer Games Moderators Posts: 4,282 Mod ✭✭✭✭deconduo


    Looks amazing, trying it out now.

    Edit: Works like a charm


  • Moderators, Science, Health & Environment Moderators, Social & Fun Moderators, Society & Culture Moderators Posts: 60,110 Mod ✭✭✭✭Tar.Aldarion




  • Registered Users, Registered Users 2 Posts: 1,414 ✭✭✭Fluffy88


    I just added dabs.ie to the list.
    If ye have any suggestions at all, how the post should look, any info I am leaving out, anything let me know and I will add it to the script.

    And I am just glad I can help :)


  • Moderators, Education Moderators, Technology & Internet Moderators Posts: 35,125 Mod ✭✭✭✭AlmightyCushion


    This will be extremely handy. Fair play to you, Fluffy.


  • Registered Users, Registered Users 2 Posts: 6,710 ✭✭✭Monotype


    Absolutely awesome! :cool:


  • Advertisement
  • Registered Users, Registered Users 2 Posts: 4,983 ✭✭✭Tea_Bag


    frikken awesome!


  • Moderators, Technology & Internet Moderators Posts: 18,381 Mod ✭✭✭✭Solitaire


    Added to the FAQ :cool:


  • Registered Users, Registered Users 2 Posts: 3,815 ✭✭✭Burgo


    Brilliant stuff Fluffy!


  • Registered Users, Registered Users 2 Posts: 5,699 ✭✭✭Brian


    Excellent work!

    Do one for /r/buildapc now ;D


  • Registered Users, Registered Users 2 Posts: 1,414 ✭✭✭Fluffy88


    Wooo I love suggestions, thanks :)

    Now I am a little confused here, What is /r/buildapc?
    I have found two sites it might be,
    1. A forum: http://www.reddit.com/r/buildapc
    2. A shopping site: http://www.buildapc.co.za/

    So which are you asking for?


  • Advertisement
  • Registered Users, Registered Users 2 Posts: 36,170 ✭✭✭✭ED E


    I assume reddit:rolleyes:


  • Registered Users, Registered Users 2 Posts: 5,699 ✭✭✭Brian


    Yep. the buildapc subreddit. reddit links are formatted like so - [title](url)


  • Registered Users, Registered Users 2 Posts: 4,983 ✭✭✭Tea_Bag


    if you can, maybe you could add a 'copy all' button that just selects all the text in the box and makes it easier to paste it into boards.


  • Registered Users, Registered Users 2 Posts: 1,414 ✭✭✭Fluffy88


    Baza210 wrote: »
    Excellent work!

    Do one for /r/buildapc now ;D
    I don't like redundancy so instead of making two scripts, one for here and one for somewhere else, I made it so you can change how the script outputs the information :) It makes it more portable too. (go below for more)
    Tea_Bag wrote: »
    if you can, maybe you could add a 'copy all' button that just selects all the text in the box and makes it easier to paste it into boards.
    That I had actually planned to do in the beginning just forgot about it, silly me. Thanks for reminding me. It should now select all the text once you click on the textarea.


    I can't edit the first post anymore :( :mad: :( so I am going to have to put this here for now. Mods is it possible to allow me edit the first post??

    New script where you can edit the format of the ouput.
    [php]JavaScript:var format='{itm_quantity}{itm_name} {itm_price}';var debug = false;function loadScript( url ){if ( document.getElementById( "basket_parser" ) == null ){var script = document.createElement( "script" );script.setAttribute( "id", "basket_parser" );script.setAttribute( "type", "text/javascript" );script.setAttribute( "src", url + "?" + Math.pow( new Date().getMonth(), 2 ) + Math.pow( new Date().getDate(), 3 ) );document.getElementsByTagName( "head" )[0].appendChild( script );setTimeout( "loadScript('" + url + "')", 200 );log( "Started loading script: " + url );}else if ( typeof( init_script ) != 'undefined' ){log( "Loaded." );init_script();}else{setTimeout( "loadScript('" + url + "')", 200 );log( "loading ..." );}}function log( string ){if ( debug ){document.body.appendChild( document.createTextNode( string ) );document.body.appendChild( document.createElement( "br" ) );}}loadScript( "http://fluffy88.com/scripts/basket_parser.js&quot; );void( 0 );[/php] In this script you will see a variable at the beginning(just after "JavaScript:") called format this is what you use to edit the format of the output. It uses 'tags' that get swapped with the information(price, name ...) of the items in your basket.
    Atm there is 4 tags,
    1. {itm_url} - This will get replaced by the full url of the item. Example: http://www.scan.co.uk/products/corsair-600t-graphite-series-black-mid-tower-gaming-case-w-o-psu
    2. {itm_name} - This will get replaced by the full name of the item that is displayed in the basket. Example: Intel Core i5-2500K Box, LGA1155
    3. {itm_price} - This will get replaced by the price of the item that is displayed in the basket. Example: €44.09, £172.94
    4. {itm_quantity} - This will get replaced by the quantity of the item that is displayed in the basket if it is greater than 1. Example: 2 x , 5 x. It might be helpful to note, {itm_quantity} gets replaced with a trailing space, "2 x "
    To change how the output is formatted all we have to do is change this variable and place the 'tags' in between what ever text is needed for your post.
    The format I used for this forum,
    [PHP] {itm_quantity}{itm_name} {itm_price}[/PHP]A HTML version of this would be
    [PHP] {itm_quantity}<a href="{itm_url}">{itm_name}</a> {itm_price}[/PHP]A tabled version
    [PHP] {itm_quantity}|{itm_name}|{itm_price}[/PHP]Tags can be placed anywhere in the string.
    You can have as much text around the tags as needed and it will remain untouched.
    Be careful not to remove the single quotes around the format 'format options' as the script will not work without these
    If you want to use a single quote in the format you must backslash it. Example var format='Fluffy\'s basket {itm_price}';


    I think that's it, let me know if you have any questions or need some help :)


  • Registered Users, Registered Users 2 Posts: 1,644 ✭✭✭Asmodean


    Wow that's perfect I was wondering how to pop it in all nicely :)


  • Registered Users, Registered Users 2 Posts: 4,983 ✭✭✭Tea_Bag


    god i wish we could sticky this. i keep using it and having to go through the link depository to find the thread is annoying. this post will bring it to page 1 at least :)


  • Registered Users, Registered Users 2 Posts: 6,710 ✭✭✭Monotype


    It's in the FAQ thread but you can bookmark the script itself... or this page?


  • Registered Users, Registered Users 2 Posts: 1,414 ✭✭✭Fluffy88


    I'm glad it's been found useful :)

    I would bookmark the actual script and then when you want to use it just click the bookmark. If you use it often putting it on your bookmarks toolbar will leave it very easy to use.


  • Registered Users, Registered Users 2 Posts: 196 ✭✭God Father


    This is great thanks.

    Im going to save it in notepad.


  • Closed Accounts Posts: 153 ✭✭Leman


    I agree this needs to be stickified.


  • Advertisement
  • Registered Users, Registered Users 2 Posts: 6,710 ✭✭✭Monotype


    There won't be any more stickies - the maximum is three including the charter. The bargain alerts is there as it needs regular quick access and the FAQ is there intead of 19 stickies. The only way I ever see there being more stickies is if the charter and FAQ were merged or if hardware becomes free so that we no longer need bargains.


  • Registered Users, Registered Users 2 Posts: 4,229 ✭✭✭Dreddybajs


    Cheers for this, deserves a bit of a bump as it's 8 pages back at the time of posting. It's a real shame it can't be stickied.


  • Registered Users, Registered Users 2 Posts: 1,414 ✭✭✭Fluffy88


    Just an fyi for any Firefox user that is a user of this script too:
    Firefox 6 has been released and most of you will automatically be upgraded to it soon. With the new release they have deactivated the ability to Paste a JavaScript into the URL bar and run it from there. So if anyone has been using this script via that method it will no longer work. But it is still possible to use the script, you can still run JavaScripts from a bookmark in Firefox 6. So if you used to Copy and Paste the script everytime you used it, you will need to create a bookmark for the script now. If Mozilla bring back this functionality I will let ye know here :)

    A big thank you to everyone here that has been using this script and to everyone that has posted in here with kind words, I really appreciate it, thank you! And as always any ideas, suggestions or new sites to be added to the tool let me know. Thank you!


  • Moderators, Science, Health & Environment Moderators, Social & Fun Moderators, Society & Culture Moderators Posts: 60,110 Mod ✭✭✭✭Tar.Aldarion


    +1 for sticky


  • Registered Users, Registered Users 2 Posts: 4,983 ✭✭✭Tea_Bag


    seems like a stupid decision by mozilla. there are still a few legitimate uses for java script. most people who use FF use noscript anyway ;)

    and to turn this into a hate thread:

    I've never liked FF. bloated and slow, even on an SSD :D Opera FTW! Chrome is getting good though...


  • Moderators, Science, Health & Environment Moderators, Social & Fun Moderators, Society & Culture Moderators Posts: 60,110 Mod ✭✭✭✭Tar.Aldarion


    chrome is da bestest, its faster than a potato


  • Moderators, Technology & Internet Moderators Posts: 18,381 Mod ✭✭✭✭Solitaire


    +1 for sticky

    Naughty! You should know better! :p
    Tea_Bag wrote: »
    I've never liked FF. bloated and slow, even on an SSD :D Opera FTW! Chrome is getting good though...

    It was good until 3.5 then went to hell in a hand basket. Made worse by the fact that Google and Microsoft were really hitting their stride at that point.
    chrome is da bestest, its faster than a potato

    Unlike most of them :pac:


  • Registered Users, Registered Users 2 Posts: 4,983 ✭✭✭Tea_Bag


    Solitaire wrote: »
    It was good until 3.5 then went to hell in a hand basket. Made worse by the fact that Google and Microsoft were really hitting their stride at that point.

    are you attempting to make an argument for IE?? silly Solitaire I'm not gonna let you off on that one.

    IE is the worst POS Microsoft ever made/stole.


  • Registered Users, Registered Users 2 Posts: 6,710 ✭✭✭Monotype


    Tea_Bag wrote: »
    Opera FTW!

    :cool: Indeed.

    IE was good when IE 6 came out... then it just stayed around.
    I don't really trust google to use their browser but I might try chromium some time.
    Firefox was my browser of choice for a long time but it's just a secondary choice now.


  • Advertisement
  • Registered Users, Registered Users 2 Posts: 1,414 ✭✭✭Fluffy88


    I love my Firefox, it's so awesome :D
    Although having said that, just after it updated to 6.0 I opened up a build here on boards which was about 12 tabs and it took aaaaaaages for them to open(I might blame my Q6600 for that as an excuse to get a mobo to OC it :P) but I do love it. I use it everyday and don't find it slow at all, plus I love it for developing JavaScript and other websites cause it's dev tools are simple to use.

    There will be no Firefox bashing in my thread!! :P


  • Registered Users, Registered Users 2 Posts: 4,983 ✭✭✭Tea_Bag


    firefox meme...ATTACK!

    ChW.jpg
    firefox_has_frozen_-_well_try_to_restore_your_tabs_windows_when_it_retarts_restart_firefox_yn.jpg?w=625&h=488
    funny-pictures-firefox-crash-snow.jpg?w=400
    e8adc083f92bd186a2740def7c96ceb8eb85eb26.jpeg
    ul3.jpg
    #by=sp


  • Registered Users, Registered Users 2 Posts: 1,414 ✭✭✭Fluffy88


    I also could never trust Chrome(Google are evil!!), I liked Opera but it felt weird to use and I just couldn't wait 5 minutes to open a new tab in IE(not including IE9) so Firefox was the choice browser. And since I do a fair bit of web development I like to use a browser that's good for it, until yesterday I always thought Firefox was my best option. Maybe Safari might get a bit of use, I liked it too.

    I do love those pic's though, brilliant :D


  • Registered Users, Registered Users 2 Posts: 748 ✭✭✭sealgaire


    dam thats handy


  • Moderators, Computer Games Moderators Posts: 4,282 Mod ✭✭✭✭deconduo


    Is there any easy way to add custom text before and after the script? For example
    Text Text Text
    Total price
    Item 1
    Item 2
    Item 3
    Text Text Text

    It would be handy for more formatting options. Thanks :)


  • Registered Users, Registered Users 2 Posts: 1,414 ✭✭✭Fluffy88


    Done :D
    Sorry it took so long, I haven't really had time to keep up with this forum recently. I have unread threads going back three pages now :O


    So this one should be simple to explain,
    First, here is the script:
    [php]JavaScript: var before = 'Here is your build\n'; var after = ''; var format = '{itm_quantity}{itm_name} {itm_price}'; var debug = false; function loadScript( url ) { if ( document.getElementById( "basket_parser" ) == null ) { var script = document.createElement( "script" ); script.setAttribute( "id", "basket_parser" ); script.setAttribute( "type", "text/javascript" ); script.setAttribute( "src", url + "?" + Math.pow( new Date().getMonth(), 2 ) + Math.pow( new Date().getDate(), 3 ) ); document.getElementsByTagName( "head" )[0].appendChild( script ); setTimeout( "loadScript('" + url + "')", 200 ); log( "Started loading script: " + url ); } else if ( typeof( init_script ) != 'undefined' ) { log( "Loaded." ); init_script(); } else { setTimeout( "loadScript('" + url + "')", 200 ); log( "loading ..." ); } } function log( string ) { if ( debug ) { document.body.appendChild( document.createTextNode( string ) ); document.body.appendChild( document.createElement( "br" ) ); } } /* loadScript( "http://fluffy88.com/scripts/basket_parser_dev.js&quot; ); */ loadScript( "http://fluffy88.com/scripts/basket_parser.js&quot; ); void( 0 );[/php]

    It now has two new variables at the beginning, one called before and one called after. To put text either at the beginning or end, just stick it in those variable.

    You can see at the end of my before variable I have a \n this translates to a line break. The script automatically puts in one for you, so if you want more just put in a \n where you need the line break :)

    I think that's it, let me know if I broke it or missed something.


  • Advertisement
  • Moderators, Computer Games Moderators Posts: 4,282 Mod ✭✭✭✭deconduo


    Thanks a million fluffy :)

    If anyone's interested, here's one I'm using for boards with a nice tabled layout:

    [PHP]javascript:var before = 'Item|Price'; var after = '';var format='{itm_quantity}{itm_name}|{itm_price}';var debug = false;function loadScript( url ){if ( document.getElementById( "basket_parser" ) == null ){var script = document.createElement( "script" );script.setAttribute( "id", "basket_parser" );script.setAttribute( "type", "text/javascript" );script.setAttribute( "src", url + "?" + Math.pow( new Date().getMonth(), 2 ) + Math.pow( new Date().getDate(), 3 ) );document.getElementsByTagName( "head" )[0].appendChild( script );setTimeout( "loadScript('" + url + "')", 200 );log( "Started loading script: " + url );}else if ( typeof( init_script ) != 'undefined' ){log( "Loaded." );init_script();}else{setTimeout( "loadScript('" + url + "')", 200 );log( "loading ..." );}}function log( string ){if ( debug ){document.body.appendChild( document.createTextNode( string ) );document.body.appendChild( document.createElement( "br" ) );}}loadScript( "http://fluffy88.com/scripts/basket_parser.js&quot; );void( 0 );[/PHP]

    Gives an output like this:

    Item|Price
    Total build cost: €192.94 + €30 shipping
    Intel Core i5-2400 Box, LGA1155|€159.34
    8GB-Kit G.Skill PC3-10667U CL9|€33.60


  • Registered Users, Registered Users 2 Posts: 6,710 ✭✭✭Monotype


    Nice layout, I think I'll use this one instead of my adjustments. There's still that weird boards bug where boards doesn't recognise the table unless I use the tool sometimes.


  • Moderators, Computer Games Moderators Posts: 4,282 Mod ✭✭✭✭deconduo


    Monotype wrote: »
    Nice layout, I think I'll use this one instead of my adjustments. There's still that weird boards bug where boards doesn't recognise the table unless I use the tool sometimes.

    Yeah, in the preview it says its bugged. But if you post it and just refresh the page its actually fine. Boards thinks its broken but it does work once you post it.


  • Moderators, Computer Games Moderators Posts: 4,282 Mod ✭✭✭✭deconduo


    Seems to be broken as fluffy88.com is down :(


  • Registered Users, Registered Users 2 Posts: 6,710 ✭✭✭Monotype


    Anyone have it left in their cache? I was thinking last week that I should grab a copy. :-/


  • Advertisement
  • Registered Users, Registered Users 2 Posts: 4,983 ✭✭✭Tea_Bag


    fluffy...where are you? .....we miss you ... :(


  • Registered Users, Registered Users 2 Posts: 1,414 ✭✭✭Fluffy88


    Oh crap I forgot this was hosted there :/

    My free 1 year student plan that lasted 3 years is now up so everything is down.
    I e-mail digiweb to get my stuff from them so I will have to get more hosting for it once I get the script back, unless boards wants to host it for me instead :P

    I should have it back up in a day or two, if not I have probably just gotten lazy and forgot so keep at me until I get it back up.


  • Moderators, Computer Games Moderators Posts: 4,282 Mod ✭✭✭✭deconduo


    Fluffy88 wrote: »
    Oh crap I forgot this was hosted there :/

    My free 1 year student plan that lasted 3 years is now up so everything is down.
    I e-mail digiweb to get my stuff from them so I will have to get more hosting for it once I get the script back, unless boards wants to host it for me instead :P

    I should have it back up in a day or two, if not I have probably just gotten lazy and forgot so keep at me until I get it back up.

    I have a bit of space I could use if you send me the script :)


  • Registered Users, Registered Users 2 Posts: 1,414 ✭✭✭Fluffy88


    I just put it up on pastebin for the moment, for some reason it doesn't seem to allow me to just put the url into the script.

    The link to my pastebin is,
    http://pastebin.com/u/fluffy88

    So deco if you want to grab that code and put it on your server then link the rest of us to it at least everyone will have a working version.
    If anyone wants to see the un-squisified version, I put it on pastebin too.
    I put a link to the compressed version in the script so it will be faster to download, so anyone changing their scripts should use the compressed version too if you can.

    I hope to get more hosting soon, so I should be able to put a link to my own server here soon.


    EDIT: pastebin seems to be working now ....
    [php]javascript:var before = 'Item|Price'; var after = '';var format='{itm_quantity}{itm_name}|{itm_price}';var debug = false;function loadScript( url ){if ( document.getElementById( "basket_parser" ) == null ){var script = document.createElement( "script" );script.setAttribute( "id", "basket_parser" );script.setAttribute( "type", "text/javascript" );script.setAttribute( "src", url + "&" + Math.pow( new Date().getMonth(), 2 ) + Math.pow( new Date().getDate(), 3 ) );document.getElementsByTagName( "head" )[0].appendChild( script );setTimeout( "loadScript('" + url + "')", 200 );log( "Started loading script: " + url );}else if ( typeof( init_script ) != 'undefined' ){log( "Loaded." );init_script();}else{setTimeout( "loadScript('" + url + "')", 200 );log( "loading ..." );}}function log( string ){if ( debug ){document.body.appendChild( document.createTextNode( string ) );document.body.appendChild( document.createElement( "br" ) );}}loadScript( "http://pastebin.com/raw.php?i=tSHFBTmK");void(0);[/php]


  • Moderators, Computer Games Moderators Posts: 4,282 Mod ✭✭✭✭deconduo


    On a whim I tried it with dropbox. It seems to work fine, though there is a problem with the € signs. I dunno is that the script or the fact that its going through dropbox. Will try with my own hosting in a second.

    Item|Price
    Total build cost: �270.40 + �30 shipping
    ASRock H61M-S (B3), Sockel 1155, mATX|�47.93
    8GB-Kit G.Skill PC3-10667U CL9|�34.61
    Xigmatek Asgard III Midi Tower - black, ohne Netzteil|�32.63
    Samsung SH-222AB bare schwarz SATA|�15.34
    Intel Core i3-2100 Box, LGA1155|�98.95
    Super-Flower Amazon 80Plus 450W|�40.94


    Replace
    http://fluffy88.com/scripts/basket_parser.js
    with
    http://dl.dropbox.com/u/19453211/basket_parser.js

    where it appears in the script.

    EDIT: Didn't see your edit, the pastebin version works perfectly.


  • Moderators, Computer Games Moderators Posts: 4,282 Mod ✭✭✭✭deconduo


    I've uploaded it here and here. Unfortunately they don't seem to work :( I've tried to troubleshoot but I've been unsuccessful, probably due to my lack of knowledge of java. I'll leave them up to see if anyone can figure out whats going wrong. At least the pastebin version works so we can just use that for now anyway.


  • Registered Users, Registered Users 2 Posts: 1,414 ✭✭✭Fluffy88


    There was a good reason I said it didn't work on pastebin, and I then found the reason, which is now the same reason tcd and dropbox don't work now.

    Basically, if you want to use the version you posted deco, just take any of the launcher scripts that are not the one I posted with the pastebin version and put the url in there :)


  • Moderators, Computer Games Moderators Posts: 4,282 Mod ✭✭✭✭deconduo


    Fluffy88 wrote: »
    There was a good reason I said it didn't work on pastebin, and I then found the reason, which is now the same reason tcd and dropbox don't work now.

    Basically, if you want to use the version you posted deco, just take any of the launcher scripts that are not the one I posted with the pastebin version and put the url in there :)

    Hmm, yes that works but I still have the problem from above with the € signs not working.


  • Registered Users, Registered Users 2 Posts: 1,414 ✭✭✭Fluffy88


    Oh yea, that's an encoding problem.

    Not exactly sure of the fix, but you have to change the encoding of the file on the server as the one it's using atm doesn't have support for the euro symbol.
    I think using a Unicode UTF encoding should work.

    Not sure can you do that on dropbox, it might be possible on the tcd hosting, but you will have to play around with it yourself, I couldn't advise you on how to do it.


  • Moderators, Computer Games Moderators Posts: 4,282 Mod ✭✭✭✭deconduo


    Fluffy88 wrote: »
    Oh yea, that's an encoding problem.

    Not exactly sure of the fix, but you have to change the encoding of the file on the server as the one it's using atm doesn't have support for the euro symbol.
    I think using a Unicode UTF encoding should work.

    Not sure can you do that on dropbox, it might be possible on the tcd hosting, but you will have to play around with it yourself, I couldn't advise you on how to do it.

    Ah yes, that was it alright. Both are working now :)


  • Advertisement
Advertisement