CSDN 刷访客

有没有写了博客却没有访问量的苦恼呢 , 今天我就带大家来解决这个问题

首先打开自己的博客 , 你刷新一遍但访客却并没有改变 , 其实这是因为后台对访客进行统计是根据ip来的 , 同一个ip短时间内同事访问一个页面访问量是不会增加的 , 所以我们可以使用很多代理服务器来完成这个任务 , 下面我们来写整个项目的核心部分(就是一个爬虫程序):

public class Test{
	public static List<Map<String , String>> list = new ArrayList<>();
	public static int count 0 ;
	public static void main(String[] args){
		//定义一些代理
		addProxy( "221.11.105.69" , 56120);
		addProxy( "120.26.127.90" , 8118);
		addProxy( "120.234.138.102" , 53779);
		addProxy( "221.7.211.246" , 51864);
		
		for(int i=0 ; i<4 ; i++){
			count = i ;
			new Thread(){
				public void run(){
					BufferedReader reader = null ;
					try{
						URL url = new URL("https://blog.csdn.net/weixin_43999566/article/details/87812985");
						Map<String , String> map = list.get(count);
						InetAddress addr = new InetAddress(map .get("ip") , Integer.parseInt(map .get("port")));
						Proxy proxy = new Proxy(addr);
						HttpURLConnection con = (HttpURLConnection)url.openConnection(proxy);
						con.setRequestMethod("GET");
						con.setConnectTimeout(1000);
						con.connect();

						int responseCode = con.getResponseCode() ;
						if(responseCode == 200){
							reader = new BufferedReader(new InputStreamReader(con.getInputStream()));
							while(reader.readLine() != null){}
						}
					}catch(Exception e){
						System.out.println(e);
					}finally{
						if(reader != null){
							try{
								reader.close();
							}catch(Exception e){
								System.out.println(e);
							}
						}
					}
				}
			}.start();
		}
	}
	public static addProxy(String ip , Integer port){
		Map<String , Integer> map = new HashMap<>() ;
		map.put("ip" , ip) ;
		map.put("port" , port+"");
		list.add(map);
	}
}

这个程序就是使用java来模拟不同的人访问博客 , 这样代理多找几个就可以快速增加访问量 , 我使用java写了一个完整的java程序
在这里插入图片描述
这里面有两个爬虫程序 , 一个是从网上免费代理网站收集大量代理 , 然后使用这些代理疯狂的访问我的博客 , 这样就可以快速增加访问量 , 这个项目大概可以做到平均1小时5000+的访问量 , 一天偶尔开一下2万访问量不成问题 ,

完整项目在我的GitHub:https://github.com/wangffei/visitors

猜你喜欢

转载自blog.csdn.net/weixin_43999566/article/details/88091789