View Single Post
Old 05-3-2012, 08:26 PM   #25
UserNameGoesHere
FFR Veteran
FFR Veteran
 
UserNameGoesHere's Avatar
 
Join Date: May 2008
Posts: 1,114
Send a message via AIM to UserNameGoesHere
Default Re: [JAVA] Site Search Help

Ah, well at least you gave it a shot.

Once you have learned more and feel you can understand the code, there are some simple improvements that can be made to it (and some difficult ones).

Simple improvements left as an exercise for when you're more ready for it:
1: Have it get the desired word from the user instead of hardcode.
2: Use a regular expression on the word to allow it to accept variants (for example, both lower and upper case, first letter capitol, etc...)
3: Have it get the desired URL from the user instead of hardcode.
4: Error handling -- as-is of course there is no error handling but it's really better to include it.

Difficult improvements:
1: Have it pull down the entire website AND all linked resources. (gifs, jpegs, CSS files, etc...)
2: Have it properly parse JavaScript to find and pull additional resources that the JavaScript links, including recursively doing so for JavaScript linking JavaScript.
3: Have it properly parse JavaScript to see if the desired word is constructed on-the-fly via JavaScript.
4: Speed up the execution time.

And keep in mind that Java is just slow too. It's quite known for this. Java is not built for speed.
__________________
Quote:
Originally Posted by Crashfan3 View Post
Man, what would we do without bored rednecks?
[SIGPIC][/SIGPIC]
UserNameGoesHere is offline   Reply With Quote