├── .gitignore ├── BigImageFetcher.zip ├── BigImageFetcher ├── css │ ├── bootstrap.min.css │ └── google-bootstrap.css ├── dist │ ├── background.js │ ├── inject.js │ ├── popup.js │ └── select.js ├── icon.jpg ├── img │ ├── checkmark.png │ ├── glyphicons-halflings-white.png │ ├── glyphicons-halflings.png │ └── setting.png ├── index.html ├── lib │ ├── jquery-2.0.0.min.js │ └── vue-csp │ │ ├── README.md │ │ ├── vue.common.js │ │ ├── vue.js │ │ ├── vue.min.js │ │ └── vue.min.js.map ├── manifest.json └── select.html ├── css ├── bootstrap.min.css └── google-bootstrap.css ├── dist ├── background.js ├── inject.js ├── popup.js └── select.js ├── fetchers └── index.js ├── guide ├── 1469430611066.png ├── 1469430745192.png ├── 1469430832382.png ├── 1469431401300.png ├── 1469431458835.png ├── 1469431505666.png ├── 1469431634854.png ├── 1469431686250.png ├── fetch.gif └── start.gif ├── gulpfile.js ├── icon.jpg ├── img ├── checkmark.png ├── glyphicons-halflings-white.png ├── glyphicons-halflings.png └── setting.png ├── index.html ├── lib ├── jquery-2.0.0.min.js ├── vue-csp │ ├── README.md │ ├── vue.common.js │ ├── vue.js │ ├── vue.min.js │ └── vue.min.js.map └── zip │ ├── deflate.js │ ├── z-worker.js │ ├── zip-fs.js │ └── zip.js ├── manifest.json ├── package.json ├── pull.cmd ├── push.cmd ├── readme.md ├── select.html ├── src ├── background │ ├── FetchItem.js │ ├── actions │ │ ├── open_window.js │ │ └── start_fetch.js │ └── background.js ├── inject │ ├── fetchors │ │ ├── baidu_image.js │ │ └── google_image.js │ ├── inject.js │ └── progress.js ├── popup │ └── popup.js ├── select │ ├── fileOperate │ │ ├── getDataUrl.js │ │ ├── getSuffix.js │ │ ├── saveFile.js │ │ └── saveFile_by_broswer.js │ ├── select.js │ └── select_download_by_zip.js └── utils.js ├── test.html └── webpack.config.js /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | .idea/ -------------------------------------------------------------------------------- /BigImageFetcher.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zouchengzhuo/BigImageFetcher/e4093df34e02f8f98d718c7b38007865da769304/BigImageFetcher.zip -------------------------------------------------------------------------------- /BigImageFetcher/dist/popup.js: -------------------------------------------------------------------------------- 1 | /******/ (function(modules) { // webpackBootstrap 2 | /******/ // The module cache 3 | /******/ var installedModules = {}; 4 | 5 | /******/ // The require function 6 | /******/ function __webpack_require__(moduleId) { 7 | 8 | /******/ // Check if module is in cache 9 | /******/ if(installedModules[moduleId]) 10 | /******/ return installedModules[moduleId].exports; 11 | 12 | /******/ // Create a new module (and put it into the cache) 13 | /******/ var module = installedModules[moduleId] = { 14 | /******/ exports: {}, 15 | /******/ id: moduleId, 16 | /******/ loaded: false 17 | /******/ }; 18 | 19 | /******/ // Execute the module function 20 | /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); 21 | 22 | /******/ // Flag the module as loaded 23 | /******/ module.loaded = true; 24 | 25 | /******/ // Return the exports of the module 26 | /******/ return module.exports; 27 | /******/ } 28 | 29 | 30 | /******/ // expose the modules object (__webpack_modules__) 31 | /******/ __webpack_require__.m = modules; 32 | 33 | /******/ // expose the module cache 34 | /******/ __webpack_require__.c = installedModules; 35 | 36 | /******/ // __webpack_public_path__ 37 | /******/ __webpack_require__.p = ""; 38 | 39 | /******/ // Load entry module and return exports 40 | /******/ return __webpack_require__(0); 41 | /******/ }) 42 | /************************************************************************/ 43 | /******/ ({ 44 | 45 | /***/ 0: 46 | /***/ function(module, exports, __webpack_require__) { 47 | 48 | /** 49 | * Created by czzou on 2016/7/22. 50 | */ 51 | var Vue=__webpack_require__(12); 52 | var utils=__webpack_require__(5); 53 | var ACTION=utils.ACTION; 54 | var SITES=utils.SITES; 55 | var DOWNLOAD_STATUS=utils.DOWNLOAD_STATUS; 56 | //$(function(){ 57 | // //绑定 58 | // $("#fetch").click(function(){ 59 | // var keyword=$("#keyword").val(); 60 | // var max=$("#max").val(); 61 | // var site=$("input[name='site']:checked").val(); 62 | // var data={action:ACTION.START_FETCH, data:{keyword:keyword, max:max, site:site}}; 63 | // chrome.runtime.sendMessage(data); //发送给background 64 | // }); 65 | //}); 66 | var FETCH_ITEMS=chrome.extension.getBackgroundPage().FETCH_ITEMS; 67 | var vm=new Vue({ 68 | el: '#wrapper', 69 | data: { 70 | tab_id:"-", 71 | fetchParam:{ 72 | keyword:"百合,玫瑰,月季", 73 | max:100,//500 74 | site:"baidu_image" 75 | }, 76 | SITES:SITES, 77 | DOWNLOAD_STATUS:DOWNLOAD_STATUS, 78 | FETCH_ITEMS: FETCH_ITEMS 79 | }, 80 | methods:{ 81 | fetch:function(){ 82 | if(!vm.fetchParam.keyword){ 83 | alert("抓取关键词不能为空!"); 84 | return; 85 | } 86 | var keyword=this.fetchParam.keyword; 87 | keyword.split(/[,,]/).forEach(function(item){ 88 | vm.fetchParam.keyword=item; 89 | chrome.runtime.sendMessage({action:ACTION.START_FETCH,data:vm.fetchParam}); 90 | }); 91 | vm.fetchParam.keyword=""; 92 | }, 93 | stop:function(tab_id){ 94 | chrome.tabs.remove(tab_id, function(){ 95 | FETCH_ITEMS.removeById(tab_id); 96 | }) 97 | }, 98 | reload:function(){ 99 | location.reload(); 100 | }, 101 | select:function(tab_id){ 102 | var url=chrome.extension.getURL("/select.html?tab_id="+tab_id); 103 | window.open(url); 104 | } 105 | } 106 | }); 107 | chrome.tabs.query({active:true,currentWindow:true},function(tab){ 108 | var tab_id=tab[0].id; 109 | vm.tab_id=tab_id; 110 | }); 111 | 112 | 113 | /***/ }, 114 | 115 | /***/ 5: 116 | /***/ function(module, exports) { 117 | 118 | /** 119 | * Created by czzou on 2016/7/22. 120 | */ 121 | var ACTION ={ 122 | SET_URL:"set_url", 123 | START_FETCH:"start_fetch", 124 | FETCH_PROGTRESS:"fetch_progress", 125 | FETCH_SUCCESS:"fetch_success" 126 | } 127 | 128 | var DOWNLOAD_STATUS={ 129 | INIT:"准备中", 130 | DOWNLOADING:"抓取中", 131 | SUCCESS:"抓取完成", 132 | ERROR:"抓取出错" 133 | } 134 | //站点列表 135 | var SITES=[ 136 | { 137 | name:"百度图片", 138 | value:"baidu_image", 139 | createUrl:function(data){ 140 | return "http://image.baidu.com/search/index?tn=baiduimage&word="+encodeURIComponent(data.keyword); 141 | } 142 | }, 143 | { 144 | name:"谷歌图片", 145 | value:"google_image", 146 | createUrl:function(data){ 147 | return "https://www.google.com.hk/search?tbm=isch&q="+encodeURIComponent(data.keyword); 148 | } 149 | } 150 | ]; 151 | /** 152 | * 根据value获取site 153 | * @param value 154 | */ 155 | SITES.getSite=function(value){ 156 | return SITES.filter(function(item){ 157 | return item.value==value; 158 | })[0]; 159 | } 160 | function formatDate(timestamp, fmt,utc) { 161 | 162 | if(!timestamp) 163 | { 164 | return ""; 165 | } 166 | var date = timestamp; 167 | if (typeof timestamp == "number") { 168 | date = new Date(timestamp); 169 | } 170 | 171 | if (!fmt) 172 | fmt = "yyyy-MM-dd hh:mm"; 173 | 174 | 175 | var o = { 176 | "M+": date.getMonth() + 1, //月份 177 | "d+": date.getDate(), //日 178 | "h+": date.getHours(), //小时 179 | "m+": date.getMinutes(), //分 180 | "s+": date.getSeconds(), //秒 181 | "q+": Math.floor((date.getMonth() + 3) / 3), //季度 182 | "S": date.getMilliseconds() //毫秒 183 | }; 184 | if (/(y+)/.test(fmt)) 185 | fmt = fmt.replace(RegExp.$1, (date.getFullYear() + "").substr(4 - RegExp.$1.length)); 186 | for (var k in o) 187 | if (new RegExp("(" + k + ")").test(fmt)) 188 | fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length))); 189 | return fmt; 190 | 191 | 192 | } 193 | exports.ACTION=ACTION; 194 | exports.DOWNLOAD_STATUS=DOWNLOAD_STATUS; 195 | exports.SITES=SITES; 196 | exports.formatDate=formatDate; 197 | 198 | /***/ }, 199 | 200 | /***/ 12: 201 | /***/ function(module, exports) { 202 | 203 | module.exports = Vue; 204 | 205 | /***/ } 206 | 207 | /******/ }); -------------------------------------------------------------------------------- /BigImageFetcher/dist/select.js: -------------------------------------------------------------------------------- 1 | /******/ (function(modules) { // webpackBootstrap 2 | /******/ // The module cache 3 | /******/ var installedModules = {}; 4 | 5 | /******/ // The require function 6 | /******/ function __webpack_require__(moduleId) { 7 | 8 | /******/ // Check if module is in cache 9 | /******/ if(installedModules[moduleId]) 10 | /******/ return installedModules[moduleId].exports; 11 | 12 | /******/ // Create a new module (and put it into the cache) 13 | /******/ var module = installedModules[moduleId] = { 14 | /******/ exports: {}, 15 | /******/ id: moduleId, 16 | /******/ loaded: false 17 | /******/ }; 18 | 19 | /******/ // Execute the module function 20 | /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); 21 | 22 | /******/ // Flag the module as loaded 23 | /******/ module.loaded = true; 24 | 25 | /******/ // Return the exports of the module 26 | /******/ return module.exports; 27 | /******/ } 28 | 29 | 30 | /******/ // expose the modules object (__webpack_modules__) 31 | /******/ __webpack_require__.m = modules; 32 | 33 | /******/ // expose the module cache 34 | /******/ __webpack_require__.c = installedModules; 35 | 36 | /******/ // __webpack_public_path__ 37 | /******/ __webpack_require__.p = ""; 38 | 39 | /******/ // Load entry module and return exports 40 | /******/ return __webpack_require__(0); 41 | /******/ }) 42 | /************************************************************************/ 43 | /******/ ({ 44 | 45 | /***/ 0: 46 | /***/ function(module, exports, __webpack_require__) { 47 | 48 | /** 49 | * Created by zm on 2016/7/24. 50 | */ 51 | 52 | var Vue=__webpack_require__(12); 53 | var formatDate=__webpack_require__(5).formatDate; 54 | 55 | var FETCH_ITEMS=chrome.extension.getBackgroundPage().FETCH_ITEMS; 56 | var tab_id=location.href.match(/tab_id=(\d+)/)[1]; 57 | if(!tab_id){ 58 | tab_id=FETCH_ITEMS[0].tab_id; 59 | } 60 | if(!tab_id){ 61 | alert("尚未未完成任何抓取!") 62 | } 63 | tab_id=parseInt(tab_id); 64 | var fetch=FETCH_ITEMS.getByTabId(tab_id); 65 | var vm=window.vm=new Vue({ 66 | el: 'body', 67 | data: { 68 | downloading:false, 69 | open_download:false, 70 | tab_id:tab_id, 71 | selectedNum:fetch.urls.length, 72 | fetch:fetch, 73 | FETCH_ITEMS: FETCH_ITEMS, 74 | }, 75 | methods:{ 76 | select:function(url){ 77 | url.selected=!url.selected; 78 | updateNum(); 79 | }, 80 | selectAll:function(url){ 81 | fetch.urls.forEach(function(url){ 82 | url.selected=true; 83 | }); 84 | updateNum(); 85 | }, 86 | unselectAll:function(){ 87 | fetch.urls.forEach(function(url){ 88 | url.selected=false; 89 | }); 90 | updateNum(); 91 | }, 92 | error:function(url){ 93 | url.selected=false; 94 | updateNum(); 95 | }, 96 | load:function(url,e){ 97 | url.img=e.srcElement; 98 | }, 99 | open_download_modal:function(){ 100 | this.open_download=true; 101 | }, 102 | close_download_modal:function(){ 103 | this.open_download=false; 104 | }, 105 | open_download_setting:function(){ 106 | chrome.tabs.create({ 107 | url: "chrome://settings/search#下载前询问每个文件的保存位置" 108 | }) 109 | }, 110 | download:function(){ 111 | var now=formatDate(new Date(),'yyyy-MM-dd hh.mm.ss'); 112 | fetch.urls.forEach(function(url){ 113 | if(!url.selected) return; 114 | chrome.downloads.download({ 115 | url: url.url, 116 | filename: fetch.keyword+"_"+fetch.site.name+"_"+now + "/" + getFileName(url.url), 117 | saveAs: false, 118 | conflictAction: "uniquify" 119 | }, function(f) { 120 | 121 | }); 122 | }); 123 | this.open_download=false; 124 | } 125 | } 126 | }); 127 | function getFileName(url){ 128 | var reg=/[^/]+?\.(?:jpg|jpeg|png|bmp|gif|ico)/; 129 | var name=url.match(reg); 130 | if(!name){ 131 | return Date.now()+".png"; 132 | } 133 | return name[0]; 134 | } 135 | function updateNum(){ 136 | var num=fetch.urls.filter(function(item){return item.selected}).length; 137 | vm.selectedNum=num; 138 | } 139 | 140 | /***/ }, 141 | 142 | /***/ 5: 143 | /***/ function(module, exports) { 144 | 145 | /** 146 | * Created by czzou on 2016/7/22. 147 | */ 148 | var ACTION ={ 149 | SET_URL:"set_url", 150 | START_FETCH:"start_fetch", 151 | FETCH_PROGTRESS:"fetch_progress", 152 | FETCH_SUCCESS:"fetch_success" 153 | } 154 | 155 | var DOWNLOAD_STATUS={ 156 | INIT:"准备中", 157 | DOWNLOADING:"抓取中", 158 | SUCCESS:"抓取完成", 159 | ERROR:"抓取出错" 160 | } 161 | //站点列表 162 | var SITES=[ 163 | { 164 | name:"百度图片", 165 | value:"baidu_image", 166 | createUrl:function(data){ 167 | return "http://image.baidu.com/search/index?tn=baiduimage&word="+encodeURIComponent(data.keyword); 168 | } 169 | }, 170 | { 171 | name:"谷歌图片", 172 | value:"google_image", 173 | createUrl:function(data){ 174 | return "https://www.google.com.hk/search?tbm=isch&q="+encodeURIComponent(data.keyword); 175 | } 176 | } 177 | ]; 178 | /** 179 | * 根据value获取site 180 | * @param value 181 | */ 182 | SITES.getSite=function(value){ 183 | return SITES.filter(function(item){ 184 | return item.value==value; 185 | })[0]; 186 | } 187 | function formatDate(timestamp, fmt,utc) { 188 | 189 | if(!timestamp) 190 | { 191 | return ""; 192 | } 193 | var date = timestamp; 194 | if (typeof timestamp == "number") { 195 | date = new Date(timestamp); 196 | } 197 | 198 | if (!fmt) 199 | fmt = "yyyy-MM-dd hh:mm"; 200 | 201 | 202 | var o = { 203 | "M+": date.getMonth() + 1, //月份 204 | "d+": date.getDate(), //日 205 | "h+": date.getHours(), //小时 206 | "m+": date.getMinutes(), //分 207 | "s+": date.getSeconds(), //秒 208 | "q+": Math.floor((date.getMonth() + 3) / 3), //季度 209 | "S": date.getMilliseconds() //毫秒 210 | }; 211 | if (/(y+)/.test(fmt)) 212 | fmt = fmt.replace(RegExp.$1, (date.getFullYear() + "").substr(4 - RegExp.$1.length)); 213 | for (var k in o) 214 | if (new RegExp("(" + k + ")").test(fmt)) 215 | fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length))); 216 | return fmt; 217 | 218 | 219 | } 220 | exports.ACTION=ACTION; 221 | exports.DOWNLOAD_STATUS=DOWNLOAD_STATUS; 222 | exports.SITES=SITES; 223 | exports.formatDate=formatDate; 224 | 225 | /***/ }, 226 | 227 | /***/ 12: 228 | /***/ function(module, exports) { 229 | 230 | module.exports = Vue; 231 | 232 | /***/ } 233 | 234 | /******/ }); -------------------------------------------------------------------------------- /BigImageFetcher/icon.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zouchengzhuo/BigImageFetcher/e4093df34e02f8f98d718c7b38007865da769304/BigImageFetcher/icon.jpg -------------------------------------------------------------------------------- /BigImageFetcher/img/checkmark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zouchengzhuo/BigImageFetcher/e4093df34e02f8f98d718c7b38007865da769304/BigImageFetcher/img/checkmark.png -------------------------------------------------------------------------------- /BigImageFetcher/img/glyphicons-halflings-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zouchengzhuo/BigImageFetcher/e4093df34e02f8f98d718c7b38007865da769304/BigImageFetcher/img/glyphicons-halflings-white.png -------------------------------------------------------------------------------- /BigImageFetcher/img/glyphicons-halflings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zouchengzhuo/BigImageFetcher/e4093df34e02f8f98d718c7b38007865da769304/BigImageFetcher/img/glyphicons-halflings.png -------------------------------------------------------------------------------- /BigImageFetcher/img/setting.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zouchengzhuo/BigImageFetcher/e4093df34e02f8f98d718c7b38007865da769304/BigImageFetcher/img/setting.png -------------------------------------------------------------------------------- /BigImageFetcher/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 20 |
页面ID | 关键词 | 站点 | 条数 | 状态 | 操作 |
---|---|---|---|---|---|
59 | | 60 | | 61 | |
62 |
63 |
64 |
65 | |
66 | 67 | 69 | | 70 |71 | 74 | 76 | | 77 |
页面ID | 关键词 | 站点 | 条数 | 状态 | 操作 |
---|---|---|---|---|---|
59 | | 60 | | 61 | |
62 |
63 |
64 |
65 | |
66 | 67 | 69 | | 70 |71 | 74 | 76 | | 77 |