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

Basket to Post script

Options
245

Comments

  • Registered Users 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 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 Posts: 734 ✭✭✭sealgaire


    dam thats handy


  • Moderators, Computer Games Moderators Posts: 4,281 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 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" ); */ loadScript( "http://fluffy88.com/scripts/basket_parser.js" ); 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,281 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" );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 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,281 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,281 Mod ✭✭✭✭deconduo


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


  • Registered Users 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 Posts: 4,983 ✭✭✭Tea_Bag


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


  • Registered Users 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,281 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 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,281 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,281 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 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,281 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 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,281 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
  • Registered Users Posts: 6,710 ✭✭✭Monotype


    Excellent! Simpsons_-_Mr_Burns.gif


  • Registered Users Posts: 7,180 ✭✭✭Serephucus


    I don't know if this is possible - I've used JS before, but not extensively - but it would be very cool if there was an option to empty your basket after selecting the script output. I find every time I go to spec a new build, I have to delete what was in my basket from the previous one.

    A truly wonderful script though; extremely useful.


  • Registered Users Posts: 1,245 ✭✭✭morgana


    Either I'm doing something horribly wrong or it doesn't work :(. I tried to parse my HWVS basket but nothing happens (I am on the Basket page with the configured PC in it). I tried all browsers, Opera, Firefox, IE8 and made sure pop-ups were enabled.


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


    Serephucus wrote: »
    I don't know if this is possible - I've used JS before, but not extensively - but it would be very cool if there was an option to empty your basket after selecting the script output. I find every time I go to spec a new build, I have to delete what was in my basket from the previous one.

    A truly wonderful script though; extremely useful.
    I have this working for hwvs, so I might put it up online today, I got a little lazy :)
    Scan is being a b**** so that might take time and I have looked at any of the others yet.
    morgana wrote: »
    Either I'm doing something horribly wrong or it doesn't work :(. I tried to parse my HWVS basket but nothing happens (I am on the Basket page with the configured PC in it). I tried all browsers, Opera, Firefox, IE8 and made sure pop-ups were enabled.
    Last time I tried, this didn't work with the PC-configurer.
    I guess I should probably fix that, but if you want to use it for now just add the items to your basket normally and then run this from the basket.


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


    Good news everyone :)

    My hosting is back up so all your old scripts will be working again.

    And as a little early christmas present for all you lovely people I added amazon to the list of sites :)
    And the empty basket button works with both amazon and hwvs
    Happy Christmas everyone :P


  • Registered Users Posts: 7,180 ✭✭✭Serephucus


    Tabled version of script for anyone the uses it:

    [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.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]

    Muchos, muchos thanks, Fluffy!


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


    morgana wrote: »
    Either I'm doing something horribly wrong or it doesn't work :(. I tried to parse my HWVS basket but nothing happens (I am on the Basket page with the configured PC in it). I tried all browsers, Opera, Firefox, IE8 and made sure pop-ups were enabled.
    It should now work with the PC-Configurer on hwvs :)

    and thanks serep


  • Registered Users Posts: 7,180 ✭✭✭Serephucus


    Problem with script...

    Info appears fine in the table, but the URL is gives is missing "http://www2.hardwareversand.de/" in each item. Might be just me, but it seems to be the same with other people posting it as well.


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


    Just updated the script, should be working properly now.

    Thanks for the heads up!


  • Advertisement
  • Registered Users Posts: 1,645 ✭✭✭k.p.h


    Fluffy88 wrote: »
    I also could never trust Chrome(Google are evil!!)

    Really Open Source = good ..? No ? Awesome script by the way really makes things easy on here.


Advertisement