This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Example of automatical rotating proxy middleware for scrapy-rotating-proxies using proxybroker | |
# | |
import codecs | |
import logging | |
from subprocess import call | |
from rotating_proxies.expire import Proxies | |
from rotating_proxies.middlewares import RotatingProxyMiddleware |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Heavily inspired by https://gist.github.com/timhughes/313c89a0d587a25506e204573c8017e4 | |
This is an example of class-based WebSocketEndpoint. | |
To use - just subclass your endpoint with RedisPubSubWebSocketEndpoint and use it as is. | |
You can also override on_connect, on_disconnect, on_receive and new on_published_message methods | |
New internal method "publish" acts like "broadcast" for any subscribed websocket | |
""" | |
import json |