HostLoc 赚分的脚本,不需要服务器,空间

v2016 2018-11-1 3031

  1. # -*- coding: utf8 -*-

  2. import requests
  3. import re


  4. def start():
  5.     s = requests.session()
  6.     username = ''
  7.     password = ''
  8.     login_url = 'https://www.hostloc.com/member.php?mod=logging&action=login&loginsubmit=yes&infloat=yes&lssubmit=yes&inajax=1'
  9.     s.post(login_url, {"username": username, 'password': password})

  10.     user_info = s.get('https://www.hostloc.com/home.php?mod=spacecp&ac=credit').text
  11.     current_money = re.search(r'金钱: </em>(\d+).+?</li>', user_info).group(1)
  12.     print("用户%s,你的金钱为%s" % (username, current_money))

  13.     for i in range(20359, 20370):
  14.         s.get('https://www.hostloc.com/space-uid-%s.html' % i)

  15.     new_money = s.get('https://www.hostloc.com/home.php?mod=spacecp&ac=credit').text
  16.     new_money = re.search(r'金钱: </em>(\d+).+?</li>', new_money).group(1)

  17.     return "用户%s,你的金钱为%s, %s" % (username, current_money, new_money)


  18. def main_handler(event, context):
  19.     return start()


  20. if __name__ == '__main__':
  21.     start()



然后使用良心云的无服务器函数(套路云也有)


最新回复 (0)