Results 1 to 6 of 6
  1. #1
    vaggelis is offline Member
    Join Date
    Feb 2012
    Posts
    2
    Rep Power
    0

    Default code to refresh and check the code of a webpage..

    Hi,
    I would like to create a code, which will refresh a web page every a time period and after every refresh to check its code in order to find a string. if it finds this string more than 1 time, to inform me with a message or a sound.
    Is it possible..?
    thanks in advance

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,423
    Rep Power
    25

    Default Re: code to refresh and check the code of a webpage..

    Yes, it is possible.

  3. #3
    ContoNick is offline Member
    Join Date
    Dec 2011
    Location
    Croatia,Zagreb
    Posts
    24
    Rep Power
    0

    Default Re: code to refresh and check the code of a webpage..

    Hi vaggelis.
    As already Norm say'd, yes it is possible.
    Since u have to check every xx time something, u can use Thread (Java 2 Platform SE v1.4.2).

    and for reading from website u can google some solution or here is one:

    Java Code:
    // code c+p from http://snippets.dzone.com/posts/show/3553
    import java.io.*;
    import java.net.URL;
    
    public class WebsiteReader
    {
    	public static BufferedReader read(String url) throws Exception{
    		return new BufferedReader(
    			new InputStreamReader(
    				new URL(url).openStream()));}
    
    	public static void main (String[] args) throws Exception{
    		BufferedReader reader = read(args[0]);
    		String line = reader.readLine();
    
    		while (line != null) {
    			System.out.println(line);
    			line = reader.readLine(); }}
    }
    if u got some clever project, we can do it together since i have a lot free time :)
    Good luck.

  4. #4
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,423
    Rep Power
    25

    Default Re: code to refresh and check the code of a webpage..


  5. #5
    vaggelis is offline Member
    Join Date
    Feb 2012
    Posts
    2
    Rep Power
    0

    Default Re: code to refresh and check the code of a webpage..

    thank you a lot..
    Norm, could you be more specific..?

  6. #6
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,423
    Rep Power
    25

    Default Re: code to refresh and check the code of a webpage..

    Do you have a specific question?
    For a large general topic like your project, you will need break it down into smaller parts and research each part.
    Google can help.

Similar Threads

  1. can someone check my code plz
    By aizen92 in forum New To Java
    Replies: 20
    Last Post: 02-21-2011, 01:19 AM
  2. Code to check if a piece of code is legal.
    By vahshir in forum New To Java
    Replies: 3
    Last Post: 08-30-2010, 04:21 AM
  3. jsp code for Refresh inputext previous value
    By ajay kumar in forum JavaServer Pages (JSP) and JSTL
    Replies: 3
    Last Post: 11-13-2009, 11:31 AM
  4. Plz Some one check my code
    By TamTam in forum AWT / Swing
    Replies: 1
    Last Post: 02-07-2009, 11:24 PM
  5. Can someone check my code
    By joz_12345 in forum Java 2D
    Replies: 7
    Last Post: 02-18-2008, 02:58 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •