@@ -226,39 +226,94 @@ anything, just run
226
226
227
227
inside virtual environment in proxy_py project directory.
228
228
229
+ How to use custom checkers/collectors?
230
+ **************************************
231
+
232
+ If you wan't to collect proxies from your source or you need proxies to work with particular site,
233
+ you can write your own collectors or/and checkers.
234
+
235
+ 1. Create your checkers/collectors in current directory following the next directory structure:
236
+
237
+ // TOOD: add more detailed readme about it
238
+
239
+ ```
240
+
241
+ local/
242
+ ├── requirements.txt
243
+ ├── checkers
244
+ │ └── custom_checker.py
245
+ └── collectors
246
+ └── custom_collector.py
247
+
248
+ ```
249
+
250
+ You can create only checker or collector if you want so
251
+
252
+ 2. Create `proxy_py/settings.py ` in current dir with the following content
253
+
254
+ ```python3
255
+
256
+ from ._settings import *
257
+ from local.checkers.custom_checker import CustomChecker
258
+
259
+ PROXY_CHECKERS = [CustomChecker]
260
+
261
+ COLLECTORS_DIRS = ['local/collectors']
262
+
263
+ ` ``
264
+
265
+ you can append your checker to PROXY_CHECKERS or COLLECTORS_DIRS instead of overriding to use built in ones as well, it's just normal python file.
266
+ See `proxy_py/_settings.py ` for more detailed instructions on options.
267
+
268
+ 3. Follow the steps in "How to install?" but download this docker-compose config instead
269
+
270
+ ```bash
271
+ wget "https://raw.githubusercontent.com/DevAlone/proxy_py/master/docker-compose-with-local.yml"
272
+ ` ``
273
+
274
+ and run with command
275
+
276
+ ```bash
277
+ docker-compose -f docker-compose-with-local.yml up
278
+ ` ``
279
+
280
+ 4. ...?
281
+
282
+ 5. Profit!
283
+
229
284
How to build from scratch?
230
285
**************************
231
286
232
- 1 Clone this repository
287
+ 1. Clone this repository
233
288
234
289
.. code-block :: bash
235
290
236
291
git clone https://github.com/DevAlone/proxy_py.git
237
292
238
- 2 Install requirements
293
+ 2. Install requirements
239
294
240
295
.. code-block :: bash
241
296
242
297
cd proxy_py
243
298
pip3 install -r requirements.txt
244
299
245
- 3 Create settings file
300
+ 3. Create settings file
246
301
247
302
.. code-block :: bash
248
303
249
304
cp config_examples/settings.py proxy_py/settings.py
250
305
251
- 4 Install postgresql and change database configuration in settings.py file
306
+ 4. Install postgresql and change database configuration in settings.py file
252
307
253
- 5 (Optional) Configure alembic
308
+ 5. (Optional) Configure alembic
254
309
255
- 6 Run your application
310
+ 6. Run your application
256
311
257
312
.. code-block :: bash
258
313
259
314
python3 main.py
260
315
261
- 7 Enjoy!
316
+ 7. Enjoy!
262
317
263
318
264
319
Mirrors
0 commit comments