package auto;
import
import java
import java
import java
//import db
public class test extends Thread{
URL weburl;
String urladdr;
public test()
{}
public test(String urladdr
{
this
this
}
public test(String urladdr)
{
try{
this
//weburl=new URL(urladdr);
this
}
catch(Exception e){System
}
public InputStream getStream(String url)
{
try{
//urladdr=url;
URL tempurl=new URL(url);
return tempurl
}catch(Exception e){System
return null;
}
public void run()
{
while(true)
{ try{
getStream(urladdr);
Thread
}catch(Exception e){}
}
}
public String getStr(InputStream in)
{
try{
StringBuffer temp=null;
BufferedReader buffer=new BufferedReader(new InputStreamReader(in));
String tempstr=
String strsum=
while ((tempstr=buffer
{
strsum=strsum+tempstr;
}
buffer
//in
return strsum;}
catch(Exception e){System
}
return
}
public String getMTVURL(String html)
{ try{
String temp=html
temp=temp
temp=
temp=temp
return temp; }catch(Exception e){System
return null;
}
public String getMTVname(String html)
{
try{
String temp=html
temp=temp
temp=temp
return temp;}
catch(Exception e){System
return null;
}
public void insertdb(String MTVURL
{
// DBoperate writer=new DBoperate();
// String insert=
// writer
}
public void getover()
{
InputStream in=getStream(urladdr);
String content=getStr(in);
String url=getMTVURL(content);
String name=getMTVname(content);
insertdb(url
}
public static void main(String[] avg)
{
for(;;)
{
try{
test look=new test(
look
Thread
}
catch(Exception e){
System
continue;}}
}
}
From:http://tw.wingwit.com/Article/program/Java/hx/201311/26768.html