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 |
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 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
__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
__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
__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
__author__ = 'brizzbane' | |
#for some reason, 'hello world' is only displayed some of the time (i.e. doing python thisfile.py producer 5 times, 'hello world' may only be printed 3 | |
import logging | |
from mtm.v2.core.log import configure_logging | |
configure_logging() | |
import sys | |
from kombu import Exchange, Queue | |
from kombu.mixins import ConsumerMixin |
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
#!/usr/bin/env python | |
# | |
# Copyright 2009 Facebook | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); you may | |
# not use this file except in compliance with the License. You may obtain | |
# a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# |
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
#!/usr/bin/env python | |
# | |
# Copyright 2009 Facebook | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); you may | |
# not use this file except in compliance with the License. You may obtain | |
# a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# |
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
import logging | |
import time | |
import pyuv | |
import gruvi | |
import pycurl | |
from io import BytesIO | |
from gruvi.futures import Future |
OlderNewer