Giter Club home page Giter Club logo

ip_pools's Introduction

从百度采集IP项目

  • 采集IP信息,保存为text,再入mongoDB

  • 采集IP信息,入库MYSQL,并作分析
  • 多进程(已完成)
  • scrapy框架
  • 完成归属地及其运营商的信息入库,并记录日志(2017-05-21)
  • 实现在类中运用多进程知识(2017-05-23)

相关SQL语句

  • 查询总记录数

    SELECT COUNT(1) FROM ip_info;

  • 按照IP段进行查询

    SELECT SUBSTRING_INDEX(ip,'.',2) ips, COUNT(1) counts FROM ip_info GROUP BY SUBSTRING_INDEX(ip,'.',2);

修改bug

  1. 问题如下(2017-05-14) findall_bug 应该匹配第一个结果结果值.

scrapy_task数据库说明

ip_info表:

CREATE TABLE `ip_info` (
  `id` int(15) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增列',
  `ip` varchar(15) NOT NULL COMMENT 'IP',
  `addr` varchar(50) DEFAULT NULL COMMENT '归属地',
  `carrieroperator` varchar(20) DEFAULT NULL COMMENT '运营商',
  `jointime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '采集时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=914751 DEFAULT CHARSET=utf8 COMMENT='IP信息表';

ip_city表:

CREATE TABLE `ip_city` (
  `id` int(15) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增列',
  `city` varchar(50) DEFAULT NULL COMMENT '归属地',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='归属地信息';

ip_carrier表:

CREATE TABLE `ip_carrier` (
  `id` int(15) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增列',
  `carrieroperator` varchar(20) DEFAULT NULL COMMENT '运营商',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='IP运营商信息';

ip_log_info表:

CREATE TABLE `ip_log_info` (
  `id` int(15) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增列',
	`ip_range` varchar(15) NOT NULL COMMENT 'IP段(AB)',
  `city_count` int(10) DEFAULT NULL COMMENT '归属地个数',
	`city_finished` char(2) DEFAULT '否' COMMENT '归属地是否完成',
	`carrier_count` int(10) DEFAULT NULL COMMENT '运营商个数',
	`carrier_finished` char(2) DEFAULT '否' COMMENT '运营商是否完成',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='IP采集信息统计进度表';

ip_pools's People

Contributors

zhangbc avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.