Example #1
0
def 吾爱破解_签到():
    if (not 吾爱破解_COOKIE):
        print("吾爱破解_COOKIE NONE!")
        return
    url = 'https://www.52pojie.cn/home.php'
    cookies = dict([cookie.split('=', 1) for cookie in 吾爱破解_COOKIE.split(';')])
    headers = {
        'Host': 'www.52pojie.cn',
        'Connection': 'keep-alive',
        'Upgrade-Insecure-Requests': '1',
        'DNT': '1',
        'User-Agent': UA,
        'Accept':
        'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9',
        'Sec-Fetch-Site': 'same-origin',
        'Sec-Fetch-Mode': 'navigate',
        'Sec-Fetch-User': '******',
        'Sec-Fetch-Dest': 'document',
        'Referer': 'https://www.52pojie.cn',
        'Accept-Language': 'zh,zh-CN;q=0.9',
    }
    params = {'mod': 'task', 'do': 'apply', 'id': '2'}
    session.get(url, headers=headers, params=params, cookies=cookies)
    params['do'] = 'draw'
    res = session.get(url, headers=headers, params=params, cookies=cookies)
    if (re.search(r'home.php\?mod=space&uid=\d+', res.text)):
        push(title="吾爱破解签到", msg="签到完毕!")
Example #2
0
def main():
    readline = ArgumentParser(description='Lookup seat availability for a'
                              ' course in myPurdue.')
    readline.add_argument('-p', '--push', action='store_true', help='Send'
                          ' a notification to your mobile device if a seat is'
                          ' available. The file ~/.config/push.py.ini must be'
                          ' configured.')
    readline.add_argument('term', metavar='<term>', type=int, help='School'
                          ' semester. For example, 201610 is Fall 2015 (take'
                          ' careful note that it uses the wrong year for fall'
                          ' terms), and 201620 is Spring 2016.')
    readline.add_argument('crn', metavar='<CRN>', type=int, help='Course'
                          ' request number.')

    args = readline.parse_args()
    course = PuCourse(args.term, args.crn)

    if course.seats > 0 and course.waits <= 0:
        result = 'There are %s open seats in %s!' % (course.seats, course.name)
        print(result)

        if args.push:
            try:
                config = push.configure()
            except KeyError:
                push.fatal_unconfigured()

            push.push(config, 'Purdue course watcher\n' + result)
Example #3
0
def netease_checkin():
    if (not NETEASE_COOKIE):
        print("NETEASE_COOKIE NONE!")
        return
    url = 'http://music.163.com/api/point/dailyTask'
    cookies = dict(
        [cookie.split('=', 1) for cookie in NETEASE_COOKIE.split(';')])
    headers = {
        'Pragma': 'no-cache',
        'DNT': '1',
        'Accept-Encoding': 'text',
        'Accept-Language': 'en,zh-CN;q=0.8,zh;q=0.6',
        'User-Agent': UA,
        'Content-Type': 'application/x-www-form-urlencoded',
        'Accept': '*/*',
        'Cache-Control': 'no-cache',
        'Referer': 'http://music.163.com/discover',
        'Connection': 'keep-alive',
    }

    params = {'type': 0}
    title = "网易云音乐签到"
    session.get(url, headers=headers, params=params, cookies=cookies)
    params['type'] = 1
    response = session.get(url,
                           headers=headers,
                           params=params,
                           cookies=cookies)
    res = response.json()
    if (res['code'] == -2):
        print(res['msg'])
    else:
        push(title=title, msg=res['msg'])
Example #4
0
    def _execute(self, options, args):
        from pull import Command as pull
        from push import Command as push

        # this looks funny, because we first create a Command object
        # and then we execute it
        pull()(None)
        push()(None)
Example #5
0
    def _execute(self, options, args):
        from pull import Command as pull
        from push import Command as push

        # this looks funny, because we first create a Command object
        # and then we execute it
        pull()(None)
        push()(None)
Example #6
0
def run():
    try:

        # Read CL arguments
        parser = argparse.ArgumentParser()
        parser.add_argument('repository', help='Repository of the built image, e.g. timmy/testy_image')
        parser.add_argument('-p', '--port', help='Port in docker configuration for the daemon. Defaulted to :4243.', 
            type=int, default=4243)
        parser.add_argument('-w', '--workspace', help='Location of project with Dockerfile at its root. Defaulted to $WORKSPACE.', 
            default=os.getenv('WORKSPACE'))
        parser.add_argument('-t', '--tag', help='Tag for the image. Defaulted to y-m-d-h-m-s (now).', 
            default=datetime.now().strftime('%Y-%m-%d-%H-%M-%S'))
        parser.add_argument('-cp', '--config_path', help='Path to the docker config file. Default is /home/jenkins/.dockercfg', 
            default='/home/jenkins/.dockercfg')


        # Look up gateway IP for docker daemon
        code, lines = shell("netstat -nr | grep '^0\.0\.0\.0' | awk '{print $2}'")
        assert code == 0, 'failure to lookup our gateway IP ?'
        host = lines[0]
        #assert host != '', 'Could not find gateway IP'

        args = parser.parse_args()
        repo = args.repository
        print "Repository set to {0}".format(repo)

        port = args.port
        host = "{0}:{1}".format(host, port)
        print "Daemon host set to {0}".format(host)

        workspace = args.workspace
        assert os.getenv('WORKSPACE') != '', 'No $WORKSPACE environment variable. Are you calling this from the Jenkins master?'
        print "Workspace set to {0}".format(workspace)

        tag = args.tag
        print "Tag set to {0}".format(tag)

        config_path = args.config_path
        print "Path to docker config set to {0}".format(config_path)

        authenticator = Authenticator()

        # Enter workflow below
        build(workspace, host, repo, tag, authenticator=authenticator)
        push(host, repo, tag, authenticator=authenticator)

        return 0

    except Exception as e:

        print e
        return 1
Example #7
0
def finaltext(header,posted,attention,url):
    logging.info("Inside final text") 
    ist = timezone('Asia/Kolkata')
    try:
        logging.info("Making the text")
        text= str(datetime.now(ist).strftime("%d-%m-%Y %H:%M:%S ")) + "\n" + "Titled: "+ str(header) +"\n" + "Posted by: " + str(posted) +"\n" +"For:  " + str(attention) + " \n"
    except Execption as e:
        logging.error("creating text failed %s",e)
    try:
         logging.info("sending text to push")
         push.push(text,url)
    except Exception as e:
        logging.error("Calling push failed %s",e)
Example #8
0
def main(username="", password=""):
    if (username == "" or password == ""):
        username = input("账号:")
        password = input("密码:")
    login(username, password)
    rand = str(round(time.time() * 1000))
    surl = f'https://api.cloud.189.cn/mkt/userSign.action?rand={rand}&clientType=TELEANDROID&version=8.6.3&model=SM-G930K'
    url = f'https://m.cloud.189.cn/v2/drawPrizeMarketDetails.action?taskId=TASK_SIGNIN&activityId=ACT_SIGNIN'
    url2 = f'https://m.cloud.189.cn/v2/drawPrizeMarketDetails.action?taskId=TASK_SIGNIN_PHOTOS&activityId=ACT_SIGNIN'
    headers = {
        'User-Agent':
        'Mozilla/5.0 (Linux; Android 5.1.1; SM-G930K Build/NRD90M; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/74.0.3729.136 Mobile Safari/537.36 Ecloud/8.6.3 Android/22 clientId/355325117317828 clientModel/SM-G930K imsi/460071114317824 clientChannelId/qq proVersion/1.0.6',
        "Referer":
        "https://m.cloud.189.cn/zhuanti/2016/sign/index.jsp?albumBackupOpened=1",
        "Host": "m.cloud.189.cn",
        "Accept-Encoding": "gzip, deflate",
    }
    response = s.get(surl, headers=headers)
    netdiskBonus = response.json()['netdiskBonus']
    if (response.json()['isSign'] == "false"):
        print(f"未签到,签到获得{netdiskBonus}M空间")
    else:
        print(f"已经签到过了,签到获得{netdiskBonus}M空间")
    headers = {
        'User-Agent':
        'Mozilla/5.0 (Linux; Android 5.1.1; SM-G930K Build/NRD90M; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/74.0.3729.136 Mobile Safari/537.36 Ecloud/8.6.3 Android/22 clientId/355325117317828 clientModel/SM-G930K imsi/460071114317824 clientChannelId/qq proVersion/1.0.6',
        "Referer":
        "https://m.cloud.189.cn/zhuanti/2016/sign/index.jsp?albumBackupOpened=1",
        "Host": "m.cloud.189.cn",
        "Accept-Encoding": "gzip, deflate",
    }
    response = s.get(url, headers=headers)
    if ("errorCode" in response.text):
        print(response.text)
        TASK_SIGNIN_msg = f"TASK_SIGNIN:{response.text}"
    else:
        description = response.json()['description']
        print(f"抽奖获得{description}")
        TASK_SIGNIN_msg = f"TASK_SIGNIN抽奖获得{description}"
    response = s.get(url2, headers=headers)
    if ("errorCode" in response.text):
        print(response.text)
        TASK_SIGNIN_PHOTOS_msg = f"TASK_SIGNIN_PHOTOS:{response.text}"
    else:
        description = response.json()['description']
        print(f"抽奖获得{TASK_SIGNIN_PHOTOS_description}")
        TASK_SIGNIN_PHOTOS_msg = f"TASK_SIGNIN_PHOTOS抽奖获得{description}"

    title = "天翼网盘签到"
    msg = f"签到获得{netdiskBonus}M空间,{TASK_SIGNIN_msg},{TASK_SIGNIN_PHOTOS_msg}"
    push(title, msg)
Example #9
0
    def push(self):
        # rsync to data center box
        import push
        p = push.push()
        p.set_options(upload_formats=self.upload_formats, )
        p.main()
        ret = p.ret

        return ret
Example #10
0
def v2ex_checkin():
    V2EX_DOMAIN = r'v2ex.com'
    V2EX_URL_START = r'https://' + V2EX_DOMAIN
    V2EX_MISSION = V2EX_URL_START + r'/mission/daily'
    V2EX_BALANCE_URL = V2EX_URL_START + r'/balance'

    def get_once_url(data):
        p = r'/mission/daily/redeem\?once=\d+'
        m = re.search(p, data)
        if m:
            return m.group()
        else:
            return None

    def get_balance(data):
        day_balance = re.search(r'\d{8} 的每日登录奖励 \d+ 铜币', data)
        if (day_balance):
            day_balance = day_balance.group()
            total_balance = re.search(r'right;">(\d+)', data).group(1)
            return f"{day_balance},余额:{total_balance}"
        else:
            print("V2EX_COOKIE ERROR!")

    def checkin():
        session.cookies.update({'A2': V2EX_COOKIE})
        session.get(V2EX_URL_START)
        data = session.get(V2EX_MISSION)
        print(data.text)
        once = get_once_url(data.text)
        if (once):
            v2ex_coin_url = V2EX_URL_START + once
            session.get(v2ex_coin_url)
        else:
            print("重复签到!")
            # return
        msg = get_balance(session.get(V2EX_BALANCE_URL).text)
        return msg

    title = 'V2ex 签到'
    msg = checkin()
    if (msg):
        push(title, msg)
Example #11
0
def main():
    #创建任务对象
    _aiqiyi = aiqiyi()
    contents = _aiqiyi.start()
    #创建信息推送对象
    _push = push()
    #钉钉推送
    try:
        _push.start(contents)
    except:
        print('[+]推送参数未填写或推送脚本出错')
Example #12
0
 def push(self):
  # rsync to data center box
  import push
  p=push.push()
  p.set_options(
      upload_formats=self.upload_formats,
      )
  p.main()
  ret = p.ret

  return ret
Example #13
0
    def update(self, time):
        path = Path(os.path.abspath('../Crawler/DATA/log'))
        logs = [
            os.path.join(path, i) for i in os.listdir(os.path.join(path))
            if re.match(f'.*{time}.*err', i)
        ]
        status = {i: os.stat(i).st_size for i in logs}

        sql = self.createsql(action='get')
        res = self.conn.fetch(sql)
        res = self.proctime(res)
        #return
        for i in status.items():
            title = i[0].split('/')[-1]
            size = i[1]
            #if True:
            if title not in list(res['title']) and size != 0:
                #if title != 'getNews_2020-10-13_美國食藥局.err': continue
                print(f'get mew {title}, updating database')

                pushedcont = self.getcont(i[0])  #.encode('Big5')
                sql = self.createsql(action='insert')
                sql = (sql.replace('TITLE',
                                   title).replace('CONTENT', pushedcont))
                #print(sql)
                self.conn.cursor.execute(sql)
                self.conn.cnxn.commit()

                para = {
                    'target': 'jen',
                    'Title': '爬蟲記錄檔錯誤訊息推播',
                    'Content': '爬蟲錯誤訊息,詳見附加檔案',
                    'PushFile': pushedcont,
                    'FileName': f'{title.replace("err","html")}'
                }
                push(**para)
                self.para = para

        self.sql = sql
        self.res = res
        self.status = status
Example #14
0
 def push(self):
  # rsync to data center box
  print "testing push.py..."
  import push
  p=push.push()
  p.set_options(force=True, verbose=True, 
      upload_formats=self.upload_formats,
      )
  p.main()
  ret = p.ret

  return ret
Example #15
0
def menuPila():
    global listaPila
    global idPila
    while True:
        print("Seleccione una opción:\n")
        print("1)Push")
        print("2)Pop")
        print("3)Salir")
        opc = int(input())
        if opc == 3:
            break
        else:
            if opc == 1:
                idPila = int(push.push(listaPila, idPila))
            elif opc == 2:
                data, idPila = pop.pop(listaPila, idPila)
            mostrarPila.mostrarPila(listaPila, idPila)
Example #16
0
    def run_monitor(self, module, ttl):
        monitor = plugins.monitor
        metric["period"] = int(ttl)
        metric["timestamp"] = int(time.time())
        # load 指标采集
        load_info = monitor["load"]()
        load_url = url + "loads"

        metric["metric"] = "load"
        metric["value"] = load_info["load"]
        push(load_url, metric)

        # cpu info
        cpu_info = monitor["cpu"]()
        cpu_url = url + "cpus"

        metric["metric"] = "cpu"
        metric["value"] = cpu_info["cpu"]
        push(cpu_url, metric)

        # mem_info
        mem_info = monitor["mem"]()
        mem_url = url + "mems"

        metric["metric"] = "mem"
        metric["value"] = mem_info["mem"]
        push(mem_url, metric)

        swap_info = monitor["swap"]()
        swap_url = url + "swaps"

        metric["metric"] = "swap"
        metric["value"] = swap_info["swap"]
        push(swap_url, metric)

        """
Example #17
0
def push_root():
    assert 'hash' in request.values.keys()
    hash_ = request.values['hash']
    txhash = push(hash_)

    return dumps({"txhash": txhash})
Example #18
0
def notify():
	Id = request.get_json()['Id']
	if Id != None:
		push(get_user_data(Id)["Subscription_info"])
	return Response(status=200)
Example #19
0
def task_push():
    from push import push

    src_file = CONFIG.get_path("output") + "/" + THEME_OUT_NAME
    dst_path = THEME_DEST_LOC
    return push(src_file, dst_path)
Example #20
0
from switch import button_state
from camera import click
from push import push
from dropbox import upload
import time

while True:
    if button_state():
        camera = click()
        time.sleep(1.0)
        push()
        camera.wait()
        upload()
Example #21
0
def yyets_checkin():
    HEADERS = {
        'User-Agent': UA,
        'Accept': '*/*',
        'Connection': 'keep-alive',
    }

    def login():
        HEADERS['Host'] = 'a.zmzapi.com'
        params = (
            ('g', 'api/public'),
            ('m', 'v2'),
            ('accesskey', '519f9cab85c8059d17544947k361a827'),
            ('client', '2'),
            ('a', 'login'),
            ('account', YYETS_ACCOUNT),
            ('password', YYETS_PASSWORD),
        )

        response = session.get('http://a.zmzapi.com/index.php',
                               headers=HEADERS,
                               params=params)
        res = response.json()
        if (res['data']):
            return res['data']
        else:
            print(res['info'])

    def checkin():
        HEADERS['HOST'] = 'h5.rrhuodong.com'
        url = 'http://h5.rrhuodong.com/index.php'

        data = login()
        if (not data):
            return
        params = (
            ('g', 'api/mission'),
            ('m', 'index'),
            ('a', 'login'),
            ('uid', data['uid']),
            ('token', data['token']),
        )
        # 访问活动页获取 Cookie
        session.get(url, headers=HEADERS, params=params)

        # 签到
        params = (
            ('g', 'api/mission'),
            ('m', 'clock'),
            ('a', 'weeks'),
            ('id', '2'),
        )
        response = session.get(url, headers=HEADERS, params=params)
        res = response.json()
        if (res['status']):
            print(res['info'])
        else:
            pass
        params = (
            ('g', 'api/mission'),
            ('m', 'clock'),
            ('a', 'store'),
            ('id', '2'),
        )
        response = session.get(url, headers=HEADERS, params=params)
        res = response.json()
        if (res['status']):
            print(res['info'])
        else:
            pass
        params = (
            ('g', 'api/mission'),
            ('m', 'index'),
            ('a', 'user_info'),
        )
        response = session.get(url, headers=HEADERS, params=params)
        return response.json()

    res = checkin()
    if (res):
        title = "人人影视签到"
        msg = f"昵称:{res['data']['nickname']},等级:{res['data']['main_group_name']},人人钻:{res['data']['point']}"
        push(title, msg)
Example #22
0
def test_push():
    settings.init()
    push("测试")
Example #23
0
from push import push

push("Hello World")
Example #24
0
import sys
from push import push
import os

assert len(sys.argv) == 2
dirpath = sys.argv[1]
if os.path.isabs(dirpath):
    pdir, dirpath = os.path.split(dirpath)
    os.chdir(pdir)
push(dirpath)
Example #25
0
            data = future.result()
        except Exception as exc:
            print((red | " ✗ ") + (bold | str(f.relative_to(work_dir))) +
                  " was not " + action +
                  (" to " + (cyan | form) if form else "") + "\n   " +
                  "\n   ".join([red | line for line in str(exc).split("\n")]))
            if I.fragile:
                exit_code = 1
        else:
            print((green | " ✓ ") + (bold | str(f.relative_to(work_dir))) +
                  " " + action + (" to " + (cyan | form) if form else "") +
                  " sucessfully")
            if isinstance(data, str) and data != "":
                print(
                    "   " +
                    "\n   ".join([yellow | line for line in data.split("\n")]))

print("::endgroup::")

if I.commit_message and I.branch:
    print("::group::pushing")
    push.push(work_dir, I)
    print("::endgroup::")

if exit_code == 0:
    print(bgreen | "Completed")
else:
    print(bred | "Failed")

exit(exit_code)
Example #26
0
#!/usr/bin/python3

from commit import script
from push import push

if __name__ == "__main__":
    script()
    push()
Example #27
0
import requests
import json
import os
import time
from push import push
from urllib import parse

_push = push()

TG_BOT_TOKEN = os.environ["TG_BOT_TOKEN"]
TG_USER_ID = os.environ["TG_USER_ID"]
p_uid = os.environ["p_uid"]
p_token = os.environ["p_token"]
data = {
    "uid": p_uid,
    "token": p_token,
}
TTbody = data
headers = {
    'Host': 'node.52tt.com',
    'Content-Type': 'application/json',
    'Origin': 'http://appcdn.52tt.com',
    'Accept-Encoding': 'gzip, deflate, br',
    'Connection': 'keep-alive',
    'Accept': '*/*',
    'User-Agent':
    'Mozilla/5.0 (iPhone; CPU iPhone OS 14_0_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 TT/5.5.6 NetType/Wifi',
    'Referer':
    'http://appcdn.52tt.com/web/frontend-web-activity-new-user-clock-in-thirty-day/index.html?device_id=2021022723524294204039a8b537a3e89d5504b84555ae01a6f15d87c9d876&ip=36.24.163.25&uid=216812508&version=84213766&appid=0&os_type=2&platform=1&app=0&market_id=0',
    'Content-Length': '575',
    'Accept-Language': 'zh-cn',
Example #28
0
def filteringClassic(predicate):
    return lambda result, input: (push(result, input)
                                  if predicate(input) else result)
Example #29
0
    chemilist = chemilist.drop_duplicates(subset=['ID', 'ChemicalChnName'])
    chemilist = chemilist.pivot_table(
        index='ChemicalChnName',
        aggfunc=lambda i: ','.join(set((','.join(i)).split(','))))
    chemilist = chemilist.reset_index(drop=False)
    res = pd.merge(right=df,
                   left=chemilist,
                   right_on='化學物質',
                   left_on='ChemicalChnName')
    res = res[['化學物質', 'theme_name', '次數']]
    res.columns = ['化學物質', '主題', '網路熱度']
    res['網路熱度'] = pd.cut(res['網路熱度'],
                         bins=[0, 5, 10, 20, 50, 100],
                         labels=['☆', '☆☆', '☆☆☆', '☆☆☆☆', '☆☆☆☆☆'])
    res['網路熱度'] = pd.Series(res['網路熱度'], dtype='object')
    res = res.fillna('')
    res = res.fillna('')

    fileName = f'daily_result/trend_{TIME}.html'
    res.to_html(fileName)

    html = postproc_res(fileName, TIME)
    para = {
        'target': 'jen',
        'Title': '輿情分析-化學物質',
        'Content': html,
        'PushFile': fileName,
        'FileName': '輿情分析.html'
    }
    push(**para)
Example #30
0
def task_push_everything():
    from push import push
    return push(get_make_config().get_path("output"))
def task_push_everything():
	from push import push
	config = get_make_config()
	return push(config.get_path(os.path.join("output", "debug", config.get_mod_dir())))
Example #32
0
def task_push_everything():
    import push
    return push.push(get_make_config().get_path("output"),
                     ".",
                     src_relative=False)
Example #33
0
def deploy(args, config):
    '''
    convenience function that builds and pushes in one call
    '''
    build(args, config)
    push(args, config)