|
You last visited: Today at 14:00
Advertisement
WarRock Profile Parser - PHP
Discussion on WarRock Profile Parser - PHP within the WarRock forum part of the Shooter category.
06/16/2014, 22:44
|
#1
|
elite*gold: 0
Join Date: Jun 2014
Posts: 22
Received Thanks: 14
|
WarRock Profile Parser - PHP
Hello everyone, does you have a clan website?
Lazy about being dipendent from other website to get informations from nexon website?
Well, all what you need its this file, my warrock profile parser.
You can find the source code here:
Don't forget to give proper credits, and to press thanks.
The output will result in a json array, all what you need its use file_get_contents to get your json array.
Array values = nickname, level, kills, deaths, headshots (the percentage), exp, country
Output sample:
PHP Code:
{"nickname":"iRazer","level":"94","kills":"688024","deaths":"323206","headshots":1,"exp":"28856551","country":"Italy"}
Please avoid useless replies such as "you can use regex instead of str_replace", i know it but i'm lazy
|
|
|
06/17/2014, 13:53
|
#2
|
elite*gold: 420
Join Date: Jan 2012
Posts: 1,082
Received Thanks: 1,000
|
Parsing HTML with RegEx is a bad idea. You should use a XML/HTML parser instead.
|
|
|
06/17/2014, 14:21
|
#3
|
elite*gold: 0
Join Date: Jun 2014
Posts: 22
Received Thanks: 14
|
Well, i just made it in 15-30 min, made just for test
|
|
|
06/17/2014, 15:15
|
#4
|
elite*gold: 420
Join Date: Jan 2012
Posts: 1,082
Received Thanks: 1,000
|
Why would you make bad code (even if it's "just for test") instead of making good code you can actually use in your products? Actually I don't see what you are testing here. Why would you post code you just made for testing? Just admit that you posted bad code and we'll never speak of it again.
|
|
|
06/17/2014, 15:42
|
#5
|
elite*gold: 0
Join Date: Jun 2014
Posts: 22
Received Thanks: 14
|
I have nothing to admit, lol, i just made it for test my html code because wa-sta api changed.
I'm not using it lol, i haven't any product where i should put this
|
|
|
06/17/2014, 16:35
|
#6
|
elite*gold: 0
Join Date: Mar 2014
Posts: 422
Received Thanks: 324
|
Quote:
Originally Posted by Peter File
Parsing HTML with RegEx is a bad idea. You should use a XML/HTML parser instead.
|
Have a closer look: He's actually not using RegEx. Even worse - split the string and replaced not required data...
Btw  seems really nice O: I may use this for template-processing purpose in future, too
|
|
|
06/17/2014, 17:06
|
#7
|
elite*gold: 420
Join Date: Jan 2012
Posts: 1,082
Received Thanks: 1,000
|
I know that he is not using RegEx but he thinks it's good to use it.
Quote:
|
Originally Posted by __Buffer
Please avoid useless replies such as "you can use regex instead of str_replace", i know it but i'm lazy
|
|
|
|
06/17/2014, 17:57
|
#8
|
elite*gold: 0
Join Date: Jul 2010
Posts: 748
Received Thanks: 569
|
Quote:
Originally Posted by Peter File
Parsing HTML with RegEx is a bad idea. You should use a XML/HTML parser instead.
|
Well okay thanks for the reply. This is a perfect example how it goes in this stupid community. Someone releases something an immediately the others start to tell how to do it better. If you claim you can do it better, write it yourself. It works, if you don't need to make a lot of requests then stick with it else you should considering optimizing the code or even rewriting it.
@ToXiiC Thanks for the release!
|
|
|
06/17/2014, 18:14
|
#9
|
elite*gold: 0
Join Date: Mar 2014
Posts: 422
Received Thanks: 324
|
 Constructive criticism should be accepted, not declined. Why don't you apply his suggesstions to your code? It's free advice to you, guys! Keep in mind: We don't want to hurt your feelings *lol*, we want you to feel yourself happier when you've written a better code. *lol²*
|
|
|
06/17/2014, 20:05
|
#10
|
elite*gold: 420
Join Date: Jan 2012
Posts: 1,082
Received Thanks: 1,000
|
@Sleutel That's what a forum is for: Discussion. You feel uncomfortable with that? Feel free to leave.
|
|
|
06/17/2014, 20:56
|
#11
|
elite*gold: 0
Join Date: Jul 2010
Posts: 748
Received Thanks: 569
|
Quote:
Originally Posted by /bin/cat
 Constructive criticism should be accepted, not declined. Why don't you apply his suggesstions to your code? It's free advice to you, guys! Keep in mind: We don't want to hurt your feelings *lol*, we want you to feel yourself happier when you've written a better code. *lol²*
|
Well this below post doesn't seem very constructive in my eyes does it in yours?
Quote:
Originally Posted by Peter File
Why would you make bad code (even if it's "just for test") instead of making good code you can actually use in your products? Actually I don't see what you are testing here. Why would you post code you just made for testing? Just admit that you posted bad code and we'll never speak of it again. 
|
If you really are positive then you would congratulate him for writing the code not telling him his code is bad. You should read a couple articles before you claim that code his code is bad. I bet you wrote bad code yourself. It's very destructive if you tell that someone code is bad. In my opinion is it good code because he wrote working code for the little knowledge he has of PHP. I know there are many solutions for solving problems but remember your solution isn't always the best. He did a great job of programming this.
Here is a perfect example:
Quote:
Originally Posted by Peter File
@Sleutel That's what a forum is for: Discussion. You feel uncomfortable with that? Feel free to leave.
|
Your argument is invalid since you generalize it and second you are aiming for me instead of my argument I gave. If you really want to discuss this then at least provide valid arguments and be positive
|
|
|
06/17/2014, 21:17
|
#12
|
elite*gold: 0
Join Date: Dec 2013
Posts: 125
Received Thanks: 129
|
I think that your source code will be useful for "coders", so... They should say thank you for this release.
|
|
|
06/17/2014, 22:18
|
#13
|
elite*gold: 420
Join Date: Jan 2012
Posts: 1,082
Received Thanks: 1,000
|
Quote:
|
Originally Posted by Sleutel
It's very destructive if you tell that someone code is bad
|
Actually it's quite the opposite. I said his code is bad but I also told him how to improve it.
Quote:
|
Originally Posted by Sleutel
You should read a couple articles before you claim that code his code is bad
|
So you are suggesting that my advice is wrong?
Quote:
|
Originally Posted by Sleutel
I know there are many solutions for solving problems but remember your solution isn't always the best.
|
My proposed solution is the best one I know. If you find a better solution that's fine but one thing I can say for sure: My solution is better than his solution.
Quote:
|
Originally Posted by Sleutel
In my opinion is it good code because he wrote working code for the little knowledge he has of PHP. [...] He did a great job of programming this.
|
It's bad code. If he has little knowledge of PHP he should be glad I give him advice. There's nothing wrong in giving advice.
Quote:
|
Originally Posted by Sleutel
Your argument is invalid since you generalize it and second you are aiming for me instead of my argument I gave. If you really want to discuss this then at least provide valid arguments and be positive
|
What argument?
And why did you post a video about micro optimization again?
|
|
|
06/17/2014, 23:26
|
#14
|
elite*gold: 0
Join Date: Jun 2014
Posts: 22
Received Thanks: 14
|
Well, my purpose was to make it working, not for making it 100% perfect coding, but i just posted here to share so you can avoid to be dependent from other websites (except the nexoneu of course)
You can use it storing everyday new searches (like the old warrock stats) so you will have your own database with all users informations.
So if the nexon eu website its offline or under maintenance you will not get any error
|
|
|
06/18/2014, 10:53
|
#15
|
elite*gold: 0
Join Date: Jul 2010
Posts: 748
Received Thanks: 569
|
Quote:
Originally Posted by Peter File
So you are suggesting that my advice is wrong
|
I didn't say your advice is wrong but the way you did it. I'm not talking about your first post but I'm talking about your second one. It's very rude to tell someones code is bad in the way you did it.
|
|
|
All times are GMT +1. The time now is 14:00.
|
|