Exemplo n.º 1
0
def usefulHttpValidator(proxies):
    target = config.ip("http_url")
    for proxy in proxies:
        proxy = proxy.decode("utf-8")
        if not validate(proxy=proxy, type="http", target=target):
            useful_http_db.srem(proxy)
import matplotlib.pyplot as plt
import numpy as np
import pylab as pl
import datetime
import matplotlib.pyplot as plt
from matplotlib.dates import DateFormatter, WeekdayLocator, DayLocator, MONDAY, YEARLY
from matplotlib.finance import quotes_historical_yahoo_ohlc, candlestick_ohlc

from matplotlib.pylab import date2num

import talib
from dateutil.parser import parse
import tushare as ts
import config

client1 = pymongo.MongoClient(config.ip(), 27017)
db1 = client1.stock.low_close


def before_month_lastday(ti, k):
    from dateutil.parser import parse
    today = parse(str(ti))

    #first = datetime.date(day=1, month=today.month, year=today.year)

    lastMonth = today - datetime.timedelta(days=k)

    def plus(k):
        if k < 10:
            return '0' + str(k)
        else:
Exemplo n.º 3
0
def rawHttpsValidator(proxies):
    target = config.ip("https_url")
    for proxy in proxies:
        proxy = proxy.decode("utf-8")
        if validate(proxy=proxy, type="https", target=target):
            useful_https_db.sadd(proxy)