This file contains hidden or 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
| __author__ = 'brizzbane' | |
| from elasticsearch_dsl import DocType | |
| from copy import deepcopy | |
| from elasticsearch import Elasticsearch | |
| from elasticsearch_dsl.connections import connections | |
| connections.create_connection(hosts=['localhost']) | |
| client = Elasticsearch() | |
| class EmailDomain(DocType): |
This file contains hidden or 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
| from Celery import Celery | |
| app = Celery('tasks', broker='amqp://guest@localhost//', backend='amqp') | |
| app.conf.CELERY_RESULT_BACKEND = 'amqp' | |
| app.conf.CELERYD_LOG_COLOR = True | |
| from elasticsearch_dsl import DocType | |
| class Account(DocType): |
This file contains hidden or 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
| { | |
| "socialnetwork:{ | |
| "properties":{ | |
| "found":{ | |
| "type":"boolean" | |
| }, | |
| "member":{ | |
| "properties":{ | |
| "member_id":{ | |
| "type":"long" |
This file contains hidden or 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
| from selenium import webdriver | |
| proxylist = ['127.0.0.1','127.0.0.2'] | |
| a = {} | |
| for proxy in proxylist: | |
| a[proxy] = webdriver.PhantomJS(executable_path='C:\Python27\selenium\phantomjs.exe',service_args=['--proxy=' + proxy + ':3128', '--proxy-type=http']) | |
| a[proxy].set_window_size(1120, 550) | |
| a[proxy].get("http://whatismyipaddress.com") | |
| a[proxy].save_screenshot(proxy + '.png') #will always end up displaying 127.0.0.1 in screenshot, while creating both 127.0.0.1.png, and 127.0.0.2.png | |
| print a[proxy].current_url |
NewerOlder