V3.0:Support new platforms

This commit is contained in:
JasonYANG170 2024-08-16 20:54:57 +08:00
parent b2ff09831e
commit 67d8d45484
7 changed files with 362 additions and 194 deletions

View File

@ -29,7 +29,7 @@
(除Linkedin外推荐使用中国IP部署) (除Linkedin外推荐使用中国IP部署)
## 支持平台 ## 支持平台
- ✅ 实习僧 - ✅ 实习僧
- ✅ 展翅 - ✅ 展翅
- 🚧 Boss直聘 - 🚧 Boss直聘
- 🚧 51 Job - 🚧 51 Job
- 🚧 Linkedin - 🚧 Linkedin

View File

@ -16,7 +16,7 @@ deviceName='HUAWEI'
# 是否启用实习僧 # 是否启用实习僧
shixiseng_state = 1 shixiseng_state = 1
yizhanchi_state = 1 yizhanchi_state = 1
bosszhipin_state = 1
# --------------实习僧配置项-------------------- # --------------实习僧配置项--------------------
# 是否投递(不投递:0,投递优先在线简历:1,投递优先离线简历:2) # 是否投递(不投递:0,投递优先在线简历:1,投递优先离线简历:2)
shixiseng_poststate = 0 shixiseng_poststate = 0
@ -30,27 +30,26 @@ shixiseng_Search = {
'nature': "", # 类型:股份制企业|合伙企业 'nature': "", # 类型:股份制企业|合伙企业
'scale': "", # 规模50-150人|500-2000人 'scale': "", # 规模50-150人|500-2000人
'ipo': "", # 融资B轮|A轮 'ipo': "", # 融资B轮|A轮
'k': "", # 岗位 * 'k': "嵌入式", # 岗位 *
'degree': "", # 学历:大专|本科 'degree': "大专|本科", # 学历:大专|本科
'emp_chance': "", # 空间:提供转正|面议 'emp_chance': "", # 空间:提供转正|面议
'intention': "", # 需求:校招|实习 'intention': "", # 需求:校招|实习
'internship_duration': "", # 在岗时间1个月|3个月以上 'internship_duration': "", # 在岗时间1个月|3个月以上
'days_per_week': "", # 工作时间4天|1天 'days_per_week': "", # 工作时间4天|1天
'payment_per_day': "" # 日薪200-300|100以下 'payment_per_day': "" # 日薪200-300|100以下
} }
# --------------翼展翅配置项-------------------- # --------------易展翅配置项--------------------
# 吐槽一下,翼展翅的数据非常的混乱,有小概率会出现城市筛选失效
yizhanchi_poststate = 0 yizhanchi_poststate = 0
yizhanchi_city="" yizhanchi_city=""
yizhanchi_Token ="" yizhanchi_Cookie =""
yizhanchi_Search = { yizhanchi_Search = {
'page_size': "50",#查询范围 * 'page_size': "1000",#查询范围 *
'page': "1",#当前页面 * 'page': "1",#当前页面 *
'positiontype': "", 'positiontype': "",
'minsalary': "",#最低工资 'minsalary': "",#最低工资
'maxsalary': "",#最高工资 'maxsalary': "",#最高工资
'show_third_position': "", 'show_third_position': "",
'keyword': "",#岗位 * 'keyword': "软件 ",#岗位 *
'region_id': "", 'region_id': "",
'intern_time_id': "", 'intern_time_id': "",
'intern_cycle_id': "", 'intern_cycle_id': "",
@ -66,4 +65,27 @@ yizhanchi_Search = {
'port': "", 'port': "",
'region_type': "", 'region_type': "",
'sort': "" 'sort': ""
}
# --------------Boss直聘配置项--------------------
bosszhipin_poststate = 0
bosszhipin_city=""
bosszhipin_Cookie =""
bosszhipin_Search = {
'scene': "1",
'query': "嵌入式",#岗位
'city': "",
'experience': "",
'payType': "",
'partTime': "",
'degree': "",
'industry': "",
'scale': "",
'stage': "",
'position': "",
'jobType': "",
'salary': "",
'multiBusinessDistrict': "",
'multiSubway': "",
'page': "1",
'pageSize': "5000"
} }

113
bosszhipin.py Normal file
View File

@ -0,0 +1,113 @@
import time
import requests
import json
from UserDefined import bosszhipin_city, bosszhipin_Search, bosszhipin_poststate, bosszhipin_Cookie
from system import Bosszhipin_CitylistUrl, Bosszhipin_SearchUrl, successful_deliveries, Bosszhipin_PostUrl
def run_bosszhipin_script():
# 初始化计数器
bosszhipin_findCount = 0
bosszhipin_successCount = 0
bosszhipin_errorCount = 0
page = 1
# 请求头
headers = {
'User-Agent': "Mozilla/5.0 (Linux; Android 14; 21051182C Build/UQ1A.240105.004.A1; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/116.0.0.0 Safari/537.36 XWEB/1160117 MMWEBSDK/20240501 MMWEBID/1136 MicroMessenger/8.0.49.2685(0x28003145) WeChat/arm64 Weixin GPVersion/1 Android Tablet NetType/WIFI Language/zh_CN ABI/arm64",
'Accept-Encoding': "gzip, deflate",
'traceid': "F-e38d9aCURcZEnWMK",
'x-requested-with': "XMLHttpRequest",
'sec-fetch-site': "same-origin",
'sec-fetch-mode': "cors",
'sec-fetch-dest': "empty",
'referer': "https://www.zhipin.com/",
'accept-language': "zh-CN,zh-SG;q=0.9,zh;q=0.8,en-US;q=0.7,en;q=0.6,zh-HK;q=0.5",
'Cookie': bosszhipin_Cookie # 将这个替换为你的实际cookie
}
# 发送GET请求获取城市代码
response = requests.get(Bosszhipin_CitylistUrl, headers=headers)
data = response.json()
# 遍历 cityGroup 查找 name 为bosszhipin_city的城市对应的 code
city_code = None
for group in data['zpData']['cityGroup']:
for city in group['cityList']:
if city['name'] == bosszhipin_city:
city_code = city['code']
break
if city_code is not None:
break
print(f"{bosszhipin_city}的code值:", city_code)
try:
while True:
bosszhipin_Search['page'] = str(page) # 设置当前页码
response = requests.get(Bosszhipin_SearchUrl, params=bosszhipin_Search, headers=headers)
data = response.json()
print(response.text)
item_list = data['zpData']['jobList']
if not item_list:
break
print("------------Boss直聘-------------")
print("在Boss直聘平台找到以下岗位即将为您投递:")
print("---------------------------------")
for item in item_list:
bosszhipin_findCount += 1
print(f"------------第{bosszhipin_findCount}家-------------")
encryptJobId = item.get('encryptJobId')
brandName = item.get('brandName')
jobName = item.get('jobName')
cityName = item.get('cityName')
salaryDesc = item.get('salaryDesc')
securityId = item.get('securityId')
welfareList=item.get('welfareList')
lid = item.get('lid')
print(f"UUID: {encryptJobId}")
print(f"公司: {brandName}")
print(f"城市: {cityName}")
print(f"岗位: {jobName}")
print(f"薪资: {salaryDesc}")
print(f"福利: {welfareList }")
# print(f"HR刷新时间: {lid}")
print("-------------Result---------------")
if(bosszhipin_poststate==1):
bosszhipin_postparams = {
"securityId": securityId,
"jobId": encryptJobId,
"lid": lid
}
bosszhipin_Postresponse = requests.get(Bosszhipin_PostUrl, params=bosszhipin_postparams, headers=headers)
data = bosszhipin_Postresponse.json()
bosszhipin_bosszhipin_poststate = data['message']
if bosszhipin_bosszhipin_poststate == '投递成功':
bosszhipin_successCount += 1
delivery_info = {
"UUID": encryptJobId,
"公司": brandName,
"城市": cityName,
"岗位": jobName,
"薪资": salaryDesc,
"福利": welfareList,
}
successful_deliveries.append(delivery_info)
else:
bosszhipin_errorCount += 1
print("投递失败,请查看返回信息:")
print(bosszhipin_bosszhipin_poststate)
else:
print("您未开启Boss直聘投递本次投递跳过")
# 投递逻辑在这里添加
# time.sleep(10)
page += 1 # 页码自增
except Exception as e:
print("Boss直聘Cookie失效请更新Cookie")
print(f"错误信息: {e}")
return bosszhipin_findCount, bosszhipin_successCount, bosszhipin_errorCount

View File

@ -1,7 +1,9 @@
# notify.py # notify.py
import requests import requests
import json import json
from UserDefined import poststate, UseResultPush, PushToken, shixiseng_state, yizhanchi_state from UserDefined import poststate, UseResultPush, PushToken, shixiseng_state, yizhanchi_state, bosszhipin_state, \
bosszhipin_poststate, yizhanchi_poststate, shixiseng_poststate
from bosszhipin import run_bosszhipin_script
from system import ResultUrl, successful_deliveries from system import ResultUrl, successful_deliveries
from shixiseng import run_shixiseng_script from shixiseng import run_shixiseng_script
from yizhanchi import run_yizhanchi_script from yizhanchi import run_yizhanchi_script
@ -16,6 +18,9 @@ def send_notifications():
notify_yizhanchi_findCount=0 notify_yizhanchi_findCount=0
notify_yizhanchi_successCount=0 notify_yizhanchi_successCount=0
notify_yizhanchi_errorCount=0 notify_yizhanchi_errorCount=0
notify_bosszhipin_findCount=0
notify_bosszhipin_successCount=0
notify_bosszhipin_errorCount=0
notify = "------------Notify---------------\n" notify = "------------Notify---------------\n"
if poststate in [1, 2]: if poststate in [1, 2]:
if(shixiseng_state==1): if(shixiseng_state==1):
@ -34,18 +39,31 @@ def send_notifications():
notify_yizhanchi_successCount=yizhanchi_successCount notify_yizhanchi_successCount=yizhanchi_successCount
errorCount=errorCount + yizhanchi_errorCount errorCount=errorCount + yizhanchi_errorCount
notify_yizhanchi_errorCount=yizhanchi_errorCount notify_yizhanchi_errorCount=yizhanchi_errorCount
if(bosszhipin_state==1):
bosszhipin_findCount, bosszhipin_successCount, bosszhipin_errorCount = run_bosszhipin_script()
findCount=findCount + bosszhipin_findCount
notify_bosszhipin_findCount=bosszhipin_findCount
successCount=successCount + bosszhipin_successCount
notify_bosszhipin_successCount=bosszhipin_successCount
errorCount=errorCount + bosszhipin_errorCount
notify_bosszhipin_errorCount=bosszhipin_errorCount
notify += (f"今日总共找到{findCount}家公司\n" notify += (f"今日总共找到{findCount}家公司\n"
f"投递成功{successCount}份,投递失败{errorCount}\n" f"投递成功{successCount}份,投递失败{errorCount}\n"
f"-------------实习僧数据------------\n" f"-------------实习僧数据------------\n"
f"找到{notify_shixiseng_findCount}家公司\n" f"找到{notify_shixiseng_findCount}家公司\n"
f"投递成功{notify_shixiseng_successCount}份,投递失败{notify_shixiseng_errorCount}\n") f"投递成功{notify_shixiseng_successCount}份,投递失败{notify_shixiseng_errorCount}\n")
if(notify_shixiseng_findCount!=0 and notify_shixiseng_successCount==0 and notify_shixiseng_errorCount==0): if(shixiseng_poststate==0):
notify += ( f"您未开启实习僧投递,本次投递跳过\n") notify += ( f"您未开启实习僧投递,本次投递跳过\n")
notify += ( f"-------------翼展翅数据------------\n" notify += ( f"-------------展翅数据------------\n"
f"找到{notify_yizhanchi_findCount}家公司\n" f"找到{notify_yizhanchi_findCount}家公司\n"
f"投递成功{notify_yizhanchi_successCount}份,投递失败{notify_yizhanchi_errorCount}\n") f"投递成功{notify_yizhanchi_successCount}份,投递失败{notify_yizhanchi_errorCount}\n")
if(notify_yizhanchi_findCount!=0 and notify_yizhanchi_successCount==0 and notify_yizhanchi_errorCount==0): if(yizhanchi_poststate==0):
notify += ( f"您未开启翼展翅投递,本次投递跳过\n") notify += ( f"您未开启易展翅投递,本次投递跳过\n")
notify += ( f"-------------Boss直聘数据------------\n"
f"找到{notify_bosszhipin_findCount}家公司\n"
f"投递成功{notify_bosszhipin_successCount}份,投递失败{notify_bosszhipin_errorCount}\n")
if(bosszhipin_poststate==0):
notify += ( f"您未开启Boss直聘投递本次投递跳过\n")
try: try:
notify += "---------成功投递的岗位信息-------\n" notify += "---------成功投递的岗位信息-------\n"
for delivery in successful_deliveries: for delivery in successful_deliveries:

View File

@ -8,7 +8,7 @@ def run_shixiseng_script():
shixiseng_successCount = 0 shixiseng_successCount = 0
shixiseng_errorCount = 0 shixiseng_errorCount = 0
shixiseng_findCount = 0 shixiseng_findCount = 0
page = 1
# 请求头 # 请求头
shixiseng_headers = { shixiseng_headers = {
'User-Agent': "sxsandroidapp/4.50.3", 'User-Agent': "sxsandroidapp/4.50.3",
@ -19,110 +19,118 @@ def run_shixiseng_script():
'priority': "u=1, i", 'priority': "u=1, i",
'Cookie': shixiseng_Cookie 'Cookie': shixiseng_Cookie
} }
while True:
shixiseng_Search['p'] = str(page) # 设置当前页码
# response = requests.get(yizhanchi_SearchUrl, params=yizhanchi_Search, headers=headers)
# 发送 GET 请求 # 发送 GET 请求
shixiseng_SearchResponse = requests.get(shixiseng_SearchUrl, params=shixiseng_Search, headers=shixiseng_headers) shixiseng_SearchResponse = requests.get(shixiseng_SearchUrl, params=shixiseng_Search, headers=shixiseng_headers)
# print(shixiseng_SearchResponse.text) # print(shixiseng_SearchResponse.text)
# 检查请求是否成功 # 检查请求是否成功
if shixiseng_SearchResponse.status_code == 200: if shixiseng_SearchResponse.status_code == 200:
data = shixiseng_SearchResponse.json() # data = shixiseng_SearchResponse.json()
try: try:
items = data['msg']['data'] data = shixiseng_SearchResponse.json()
items = data['msg']['data']
uuid_list = [item['uuid'] for item in items] if not items:
company_list = [item['company'] for item in items] break
job_list = [item['job'] for item in items]
salary_desc_list = [item['salary_desc'] for item in items]
attraction_list = [item['attraction'] for item in items]
city_list = [item['city'] for item in items]
print("------------实习僧APP-------------")
print("在实习僧平台找到以下岗位,即将为您投递:")
print("---------------------------------")
for uuid, company, job, salary_desc, attraction, city in zip(uuid_list, company_list, job_list, salary_desc_list, attraction_list, city_list): uuid_list = [item['uuid'] for item in items]
attraction_str = json.dumps(attraction, ensure_ascii=False) company_list = [item['company'] for item in items]
shixiseng_Groupid = {'inuuid': uuid} job_list = [item['job'] for item in items]
salary_desc_list = [item['salary_desc'] for item in items]
attraction_list = [item['attraction'] for item in items]
city_list = [item['city'] for item in items]
shixiseng_GroupResponse = requests.get(shixiseng_GroupUrl, params=shixiseng_Groupid, headers=shixiseng_headers) print("------------实习僧-------------")
print("在实习僧平台找到以下岗位,即将为您投递:")
print("---------------------------------")
if shixiseng_GroupResponse.status_code == 200: for uuid, company, job, salary_desc, attraction, city in zip(uuid_list, company_list, job_list, salary_desc_list, attraction_list, city_list):
group_data = shixiseng_GroupResponse.json() attraction_str = json.dumps(attraction, ensure_ascii=False)
shixiseng_Groupid = {'inuuid': uuid}
try: shixiseng_GroupResponse = requests.get(shixiseng_GroupUrl, params=shixiseng_Groupid, headers=shixiseng_headers)
group_items = group_data['msg']['resume']
deliver_able_list = [item['deliver_able'] for item in group_items]
group_list = [item['group_uuid'] for item in group_items]
deliver_able_online = deliver_able_list[0] if len(deliver_able_list) > 0 else False if shixiseng_GroupResponse.status_code == 200:
deliver_able_local = deliver_able_list[1] if len(deliver_able_list) > 1 else False group_data = shixiseng_GroupResponse.json()
shixiseng_findCount=shixiseng_findCount + 1
print(f"------------第{shixiseng_findCount}家-------------")
print(f"UUID: {uuid}")
print(f"公司: {company}")
print(f"城市: {city}")
print(f"岗位: {job}")
print(f"薪资: {salary_desc}")
print(f"福利: {attraction_str}")
print(f"在线简历投递状态: {'可投递' if deliver_able_online else '不可投递'}")
print(f"本地简历投递状态: {'可投递' if deliver_able_local else '不可投递'}")
print("-------------Result---------------")
usegroup = None # 初始化 usegroup
if (shixiseng_poststate == 1 and deliver_able_online) or (shixiseng_poststate == 2 and not deliver_able_local and deliver_able_online): try:
usegroup = group_list[0] group_items = group_data['msg']['resume']
elif (shixiseng_poststate == 1 and not deliver_able_online and deliver_able_local) or (shixiseng_poststate == 2 and deliver_able_local): deliver_able_list = [item['deliver_able'] for item in group_items]
usegroup = group_list[1] group_list = [item['group_uuid'] for item in group_items]
elif (shixiseng_poststate == 0 and (deliver_able_online or deliver_able_local)):
usegroup = None
if usegroup:
shixiseng_Postpayload = json.dumps({
"inuuid": uuid,
"group_uuid": usegroup,
"stype": "attach",
"report_time": "1周内",
"internship_time": "6个月以上",
"days": "5",
"mxa_data": "",
"position": "app_search_xgzw",
"deliver_type": 0
})
shixiseng_PostResponse = requests.post(shixiseng_PostUrl, data=shixiseng_Postpayload, headers=shixiseng_headers) deliver_able_online = deliver_able_list[0] if len(deliver_able_list) > 0 else False
data = shixiseng_PostResponse.json() deliver_able_local = deliver_able_list[1] if len(deliver_able_list) > 1 else False
shixiseng_shixiseng_poststate = data['msg']['cont'] shixiseng_findCount=shixiseng_findCount + 1
if shixiseng_shixiseng_poststate == 'success': print(f"------------第{shixiseng_findCount}家-------------")
shixiseng_successCount += 1 print(f"UUID: {uuid}")
delivery_info = { print(f"公司: {company}")
"UUID": uuid, print(f"城市: {city}")
"公司": company, print(f"岗位: {job}")
"城市": city, print(f"薪资: {salary_desc}")
"岗位": job, print(f"福利: {attraction_str}")
"薪资": salary_desc, print(f"在线简历投递状态: {'可投递' if deliver_able_online else '不可投递'}")
"福利": attraction_str, print(f"本地简历投递状态: {'可投递' if deliver_able_local else '不可投递'}")
# "投递来自": "在线简历" if usegroup == group_list[0] else "本地简历" print("-------------Result---------------")
} usegroup = None # 初始化 usegroup
successful_deliveries.append(delivery_info)
if (shixiseng_poststate == 1 and deliver_able_online) or (shixiseng_poststate == 2 and not deliver_able_local and deliver_able_online):
usegroup = group_list[0]
elif (shixiseng_poststate == 1 and not deliver_able_online and deliver_able_local) or (shixiseng_poststate == 2 and deliver_able_local):
usegroup = group_list[1]
elif (shixiseng_poststate == 0 and (deliver_able_online or deliver_able_local)):
usegroup = None
if usegroup:
shixiseng_Postpayload = json.dumps({
"inuuid": uuid,
"group_uuid": usegroup,
"stype": "attach",
"report_time": "1周内",
"internship_time": "6个月以上",
"days": "5",
"mxa_data": "",
"position": "app_search_xgzw",
"deliver_type": 0
})
shixiseng_PostResponse = requests.post(shixiseng_PostUrl, data=shixiseng_Postpayload, headers=shixiseng_headers)
data = shixiseng_PostResponse.json()
shixiseng_shixiseng_poststate = data['msg']['cont']
if shixiseng_shixiseng_poststate == 'success':
shixiseng_successCount += 1
delivery_info = {
"UUID": uuid,
"公司": company,
"城市": city,
"岗位": job,
"薪资": salary_desc,
"福利": attraction_str,
# "投递来自": "在线简历" if usegroup == group_list[0] else "本地简历"
}
successful_deliveries.append(delivery_info)
else:
shixiseng_errorCount += 1
print(shixiseng_shixiseng_poststate)
else: else:
shixiseng_errorCount += 1 if shixiseng_poststate == 0:
print(shixiseng_shixiseng_poststate) print("您未开启实习僧投递,本次投递跳过")
else: elif shixiseng_poststate in [1, 2]:
if shixiseng_poststate == 0:
print("您未开启实习僧投递,本次投递跳过")
elif shixiseng_poststate in [1, 2]:
print("您已投递过该公司,本次投递跳过")
except KeyError as e:
print(f"获取投递状态数据失败: {e}")
else:
print(f"投递状态请求失败HTTP状态码: {shixiseng_GroupResponse.status_code}")
except Exception as e:
print("实习僧中没有相关工作,请尝试放宽筛选")
print(f"错误信息: {e}")
else: print("您已投递过该公司,本次投递跳过")
print(f"请求失败HTTP状态码: {shixiseng_SearchResponse.status_code}") except KeyError as e:
print(f"获取投递状态数据失败: {e}")
else:
print(f"投递状态请求失败HTTP状态码: {shixiseng_GroupResponse.status_code}")
except Exception as e:
print("实习僧中没有相关工作,请尝试放宽筛选")
print(f"错误信息: {e}")
else:
print(f"请求失败HTTP状态码: {shixiseng_SearchResponse.status_code}")
page += 1
return shixiseng_findCount, shixiseng_successCount, shixiseng_errorCount return shixiseng_findCount, shixiseng_successCount, shixiseng_errorCount

View File

@ -5,4 +5,8 @@ shixiseng_SearchUrl = "https://apigateway-h3.shixiseng.com/api/interns/v3.0/inte
shixiseng_GroupUrl = "https://apigateway-h3.shixiseng.com/api/deliver/v3.0/deliver/options" shixiseng_GroupUrl = "https://apigateway-h3.shixiseng.com/api/deliver/v3.0/deliver/options"
shixiseng_PostUrl = "https://apigateway-h3.shixiseng.com/api/deliver/v3.0/deliver" shixiseng_PostUrl = "https://apigateway-h3.shixiseng.com/api/deliver/v3.0/deliver"
yizhanchi_SearchUrl = "https://api.izhanchi.com/position/recommend/index" yizhanchi_SearchUrl = "https://api.izhanchi.com/position/recommend/index"
yizhanchi_PostUrl = "https://api.izhanchi.com/user/send/" yizhanchi_PostUrl = "https://api.izhanchi.com/user/send/"
yizhanchi_CitylistUrl = "https://api.izhanchi.com/index/citylist"
Bosszhipin_CitylistUrl = "https://www.zhipin.com/wapi/zpCommon/data/cityGroup.json"
Bosszhipin_SearchUrl = "https://www.zhipin.com/wapi/zpgeek/search/joblist.json"
Bosszhipin_PostUrl = "https://www.zhipin.com/wapi/zpgeek/friend/add.json"

View File

@ -1,109 +1,112 @@
import json import json
import requests import requests
from datetime import datetime from datetime import datetime
from datetime import datetime import time
import time # 引入time模块 from UserDefined import yizhanchi_Search, yizhanchi_city, deviceName, yizhanchi_poststate, yizhanchi_Cookie
from UserDefined import yizhanchi_Search, yizhanchi_city, deviceName, yizhanchi_poststate, \ from system import yizhanchi_SearchUrl, yizhanchi_PostUrl, successful_deliveries, yizhanchi_CitylistUrl
yizhanchi_Token
from system import yizhanchi_SearchUrl, yizhanchi_PostUrl, successful_deliveries
def run_yizhanchi_script(): def run_yizhanchi_script():
yizhanchi_findCount=0 yizhanchi_findCount = 0
yizhanchi_successCount=0 yizhanchi_successCount = 0
yizhanchi_errorCount=0 yizhanchi_errorCount = 0
page = 1
headers = { headers = {
'User-Agent': "Mozilla/5.0 (Linux; Android 14;" +deviceName+" Build/UQ1A.240505.004.A1; wv) AppleWebKit/539.36 (KHTML, like Gecko) Version/4.0 Chrome/116.0.0.0 Safari/537.36 XWEB/1170117 MMWEBSDK/20240301 MMWEBID/1139 MicroMessenger/8.0.49.2685(0x28003145) WeChat/arm64 Weixin GPVersion/1 Android Tablet NetType/WIFI Language/zh_CN ABI/arm64 MiniProgramEnv/android", 'User-Agent': f"Mozilla/5.0 (Linux; Android 14; {deviceName} Build/UQ1A.240505.004.A1; wv) AppleWebKit/539.36 (KHTML, like Gecko) Version/4.0 Chrome/116.0.0.0 Safari/537.36 XWEB/1170117 MMWEBSDK/20240301 MMWEBID/1139 MicroMessenger/8.0.49.2685(0x28003145) WeChat/arm64 Weixin GPVersion/1 Android Tablet NetType/WIFI Language/zh_CN ABI/arm64 MiniProgramEnv/android",
'Accept-Encoding': "gzip,compress,br,deflate", 'Accept-Encoding': "gzip,compress,br,deflate",
'charset': "utf-8", 'charset': "utf-8",
'live-channel-id': "",
'content-type': "application/json; charset=UTF-8", 'content-type': "application/json; charset=UTF-8",
'nonce': "0.9293333376178894", 'timestamp': str(int(time.time() * 1000)),
'share-user-id': "0", 'Cookie': yizhanchi_Cookie,
'promotion-user-id': "0",
'from': "Android",
'sign': "3k57a99c0ea677999434cc5a996b2578",
'business-type': "",
'page-route': "https://m.izhanchi.com/",
'business-type-id': "0",
'region': "zp",
'Content-Type': "application/json; charset=UTF-8",
'timestamp': str(int(time.time() * 1000)), # 使用当前时间戳
'campus-channel-type': "0",
'campus-channel-id': "0",
'token': yizhanchi_Token,
'appkey': "yizhanchi", 'appkey': "yizhanchi",
'version': "H5_3.3.3", 'version': "H5_3.3.3",
'Origin': "https://m.izhanchi.com",
'X-Requested-With': "com.tencent.mm",
'Sec-Fetch-Site': "same-site",
'Sec-Fetch-Mode': "cors",
'Sec-Fetch-Dest': "empty",
'Referer': "https://m.izhanchi.com/", 'Referer': "https://m.izhanchi.com/",
'Accept-Language': "zh-CN,zh-SG;q=0.9,zh;q=0.8,en-US;q=0.7,en;q=0.6,zh-HK;q=0.5" 'Accept-Language': "zh-CN,zh-SG;q=0.9,zh;q=0.8,en-US;q=0.7,en;q=0.6,zh-HK;q=0.5"
} }
response = requests.get(yizhanchi_SearchUrl, params=yizhanchi_Search, headers=headers) response = requests.get(yizhanchi_CitylistUrl, headers=headers)
data = response.json() data = response.json()
# 提取职位信息 yizhanchi_city_id = None
items = data['data']['data'] for item in data["data"]:
if item["name"] == yizhanchi_city:
yizhanchi_city_id = item["id"]
break
# 按照refreshtime字段进行排序降序排列 if yizhanchi_city_id is not None:
sorted_items = sorted(items, key=lambda x: datetime.strptime(x['refreshtime'], "%Y-%m-%d %H:%M:%S"), reverse=True) print(f'{yizhanchi_city}的id值是: {yizhanchi_city_id}')
print("------------翼展翅APP-------------") else:
print("在翼展翅平台找到以下岗位,即将为您投递:") print(f'没有找到 name 为 "{yizhanchi_city}" 的数据')
print("---------------------------------") return yizhanchi_findCount, yizhanchi_successCount, yizhanchi_errorCount
# 仅显示 area_name 或 second_area_name 或 city_name 为 '深圳' 的结果
for item in sorted_items: yizhanchi_Search['region_id'] = f"{yizhanchi_city_id}"
city_name = item['city_name']
area_name = item['area_name'] while True:
second_area_name = item['second_area_name'] yizhanchi_Search['page'] = str(page) # 设置当前页码
if yizhanchi_city in [city_name, area_name, second_area_name]: response = requests.get(yizhanchi_SearchUrl, params=yizhanchi_Search, headers=headers)
yizhanchi_findCount=yizhanchi_findCount + 1 data = response.json()
print(f"------------第{yizhanchi_findCount}家-------------") items = data['data']['data']
positionid = item['positionid']
companyname = item['companyname'] if not items:
positionname = item['positionname'] break
salary_name = item['salary_name']
refreshtime = item['refreshtime'] sorted_items = sorted(items, key=lambda x: datetime.strptime(x['refreshtime'], "%Y-%m-%d %H:%M:%S"), reverse=True)
position_strongpoint = item['position_strongpoint'] print("------------易展翅-------------")
print(f"UUID: {positionid}") print("在易展翅平台找到以下岗位,即将为您投递:")
print(f"公司: {companyname}") print("---------------------------------")
print(f"城市: {city_name}")
print(f"岗位: {positionname}") for item in sorted_items:
print(f"薪资: {salary_name}") city_name = item['city_name']
print(f"福利: {position_strongpoint}") area_name = item['area_name']
print(f"HR刷新时间: {refreshtime}") second_area_name = item['second_area_name']
print("-------------Result---------------")
if(yizhanchi_poststate==1): if '深圳' in [city_name, area_name, second_area_name]:
yizhanchi_postparams = { yizhanchi_findCount += 1
'attachment_id': "", print(f"------------第{yizhanchi_findCount}家-------------")
'qiniu_id': "", positionid = item['positionid']
'is_top': "1", companyname = item['companyname']
'deliery_source': "4", positionname = item['positionname']
'specific_source': "", salary_name = item['salary_name']
'source': "" refreshtime = item['refreshtime']
} position_strongpoint = item['position_strongpoint']
yizhanchi_Postresponse = requests.get(yizhanchi_PostUrl+positionid, params=yizhanchi_postparams, headers=headers) print(f"UUID: {positionid}")
data = yizhanchi_Postresponse.json() print(f"公司: {companyname}")
yizhanchi_yizhanchi_poststate = data['message'] print(f"城市: {city_name}")
if yizhanchi_yizhanchi_poststate == '投递成功': print(f"岗位: {positionname}")
yizhanchi_successCount += 1 print(f"薪资: {salary_name}")
delivery_info = { print(f"福利: {position_strongpoint}")
"UUID": positionid, print(f"HR刷新时间: {refreshtime}")
"公司": companyname, print("-------------Result---------------")
"城市": city_name,
"岗位": positionname, if yizhanchi_poststate == 1:
"薪资": salary_name, yizhanchi_postparams = {
"福利": position_strongpoint, 'attachment_id': "",
# "投递来自": "在线简历" if usegroup == group_list[0] else "本地简历" 'qiniu_id': "",
'is_top': "1",
'deliery_source': "4",
'specific_source': "",
'source': ""
} }
successful_deliveries.append(delivery_info) yizhanchi_Postresponse = requests.get(yizhanchi_PostUrl + positionid, params=yizhanchi_postparams, headers=headers)
data = yizhanchi_Postresponse.json()
yizhanchi_yizhanchi_poststate = data['message']
if yizhanchi_yizhanchi_poststate == '投递成功':
yizhanchi_successCount += 1
delivery_info = {
"UUID": positionid,
"公司": companyname,
"城市": city_name,
"岗位": positionname,
"薪资": salary_name,
"福利": position_strongpoint,
}
successful_deliveries.append(delivery_info)
else:
yizhanchi_errorCount += 1
print("投递失败,请查看返回信息:")
print(yizhanchi_yizhanchi_poststate)
else: else:
yizhanchi_errorCount += 1 print("您未开启易展翅投递,本次投递跳过")
print("投递失败,请查看返回信息:")
print(yizhanchi_yizhanchi_poststate) page += 1 # 页码自增
else:
print("您未开启翼展翅投递,本次投递跳过") return yizhanchi_findCount, yizhanchi_successCount, yizhanchi_errorCount
return yizhanchi_findCount, yizhanchi_successCount, yizhanchi_errorCount