Jump to content

Getting levels from highscores in java.


FuriousElf

Recommended Posts

I was wondering how I could make a method that gets the level from a player in a certain skill. Can someone explain me that?

 

 

 

 

 

 

 

It would be even better if someone could post a pre-made one, I found out I learn the best by viewing examples.

wccape,Furious%20%20Elf.gif

Link to comment
Share on other sites

Using the highscores URL, replace with the rsn you want to look up. Open the URL through your code, strip the HTML and then work with the bare text to find the info you need.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

I've never done this in Java so I don't know the specifics but the methods for getting to the info are the same.

Link to comment
Share on other sites

I have a method written in perl, not java, but the concept is the same.

 

 

 

 

 

 

 

It really all boils down to the parsing and how much detail you intend to pull out. Also, whenever RS changes the way their page is formatted, you will have to updated your parsing, since it may or may not hold.

 

 

 

 

 

 

 

The current regular expression I use has held up pretty good. I had to modify it recently to include line breaks:

 

 

 

$content =~ /$_.*?\>(\d{2}|Not Ranked)\;

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.