I'm making a program in Java to parse data from a webpage on the steam community market. I know that the steamcommunity market blocks connections for a period of time if the connection is accessing the market too many times in a certain period. Right now, my program access a webpage every 250 milliseconds, and it will do that 10 times before switching to another proxy. My problem is that I will still get http error 429 (too many requests) even if I switch proxies. I know that the proxy switching works because I access my ip from http://checkip.amazonaws.com and it will return the ip of the new proxy. Does the steamcommunity market block clients as well as connections? Is there a way around this?
Here is the code:
switch(proxyInt){
case 0:
System.out.println("default");
break;
case 1:
System.setProperty("http.proxyHost", "104.238.131.206");
System.setProperty("http.proxyPort", "8080");
break;
case 2:
System.setProperty("http.proxyHost", "158.85.241.82");
System.setProperty("http.proxyPort", "1080");
break;
case 3:
System.setProperty("http.proxyHost", "45.63.85.44");
System.setProperty("http.proxyPort", "3128");
break;
}
URL whatismyip = new URL("http://checkip.amazonaws.com");
BufferedReader ins = new BufferedReader(new InputStreamReader(whatismyip.openStream()));
String ip = ins.readLine();
System.out.println(ip);
URL url = new URL("http://steamcommunity.com/market/priceoverview/?currency=1&appid=730&market_hash_name=" + skins[x].substring(46));
BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream()));
String gun = in.readLine();
skinsLowest[x] = moneyLowest(gun);
skinsMedian[x] = moneyMedian(gun);
skinsProfit[x] = skinsMedian[x] * .87 - skinsLowest[x];
lowestPrices[x].setText(skinsLowest[x] + "");
medianPrices[x].setText(skinsMedian[x] + "");
String round = skinsProfit[x] + "";
profitPrices[x].setText(round.substring(0, 5));
System.out.println("Lowest: " + skinsLowest[x]);
System.out.println("Median: " + skinsMedian[x]);
repaint();
if(x % 10 == 0 && x != 0)
proxyInt++;
if(x == amount)
x = 0;
else
x++;