Wondering if anyone can help me with this.
First off, why is this in java? Because that is what I am most familiar with. If you have any other easier alternatives, please let me know.
ArtofApocalypse and myself maintain a spreadsheet in the league subforum found here:
http://forums.d2jsp.org/topic.php?t=69074957&f=133We want to have something that will check all of the url's in the second column and see if there is a change in the current rank.
I have a program working that does what we need but the way I open the URL will randomly hang(Will work perfectly on the first half of the list then will get stuck and cannot open one of the pages so it hangs).
The code I use for opening the url is this:
Code
URL url = new URL(inputUrl);
URLConnection spoof = url.openConnection();
//Spoof the connection so we look like a web browser
spoof.setRequestProperty( "User-Agent", "Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0; H010818)" );
BufferedReader in = new BufferedReader(new InputStreamReader(spoof.getInputStream())); //Hangs here every time.
... the rest of my code that is needed ...
It randomly gets stuck half way through with this solution. Does anybody know another better way to open up the connection. The only thing I need is the page source.
-----------------------------------------
Another question as well. Has anybody done any work with opening an excel file in java? I am using Apache POI but it only works with 97-03 excel format and explodes if you have a bunch of formatting. Any other alternatives for this?
Thanks.
E/UPDATE: I isolated which line it is failing on. It seems to be pretty random. Failed 25th link once, 47th second.. etc. Hangs at those for over 10 minutes before I stopped it.
Perhaps it would go eventaully but this is totally useless if it is going to hang for 10+ mins.
This post was edited by Kagura on Jan 7 2014 01:51am