Advertisement
Guest User

Untitled

a guest
Aug 24th, 2016
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.75 KB | None | 0 0
  1. package readdata;
  2.  
  3. import java.net.*;
  4. import java.io.*;
  5. import java.util.regex.Pattern;
  6. import java.util.regex.Matcher;
  7.  
  8.  
  9. public class aaa
  10. {
  11.     public static void main(String[] args) throws Exception {
  12.  
  13.         URL oracle = new URL("http://redpanel.bugged.ro/complaints/staff/");
  14.         BufferedReader in = new BufferedReader(
  15.         new InputStreamReader(oracle.openStream()));
  16.  
  17.         String inputLine;
  18.         StringBuilder a = new StringBuilder();
  19.         while ((inputLine = in.readLine()) != null)
  20.             a.append(inputLine);
  21.         in.close();
  22.    
  23.  
  24.     int i = 0;
  25.     Pattern p = Pattern.compile("Open");
  26.     Matcher m = p.matcher( a );
  27.     while (m.find()) {
  28.             i++;
  29.         System.out.println(i);
  30.     }
  31.     }
  32.  
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement