大家好,我是一行
今天分享的文章讓你霸屏微信運動,橫掃支付寶榜單
項目意義
如果你想在支付寶螞蟻森林收集很多能量種樹,為環境綠化出一份力量,又或者是想每天稱霸微信運動排行榜裝逼,卻不想出門走路,那么該 python 腳本可以幫你實現。
實現方法
手機安裝第三方軟件樂心健康,注冊賬號登錄,將運動數據同步到微信和支付寶。用 python 腳本遠程修改樂心健康當前登錄賬號的步數即可。
第一步:在手機上安裝樂心健康 app。
安卓版下載地址: ( )
蘋果版下載地址:( )
第二步:注冊賬號登錄,并設置登錄密碼。
第三步:完成第三方同步,將運動數據同步到微信和支付寶。
第四步:運行 python 腳本,修改樂心健康步數。
python 代碼
程序設定是每天 7 點自動修改步數,在下面腳本對應的位置替換填入樂心健康賬號、樂心健康密碼、修改步數,然后運行程序。修改步數推薦設置范圍是 30000 至 90000,步數值太大會導致修改不成功。如果想改變第二天自動修改步數的時間,請修改圖示位置的 25200,+25200 代表第二天 0 點后加上的秒數,也就是 7x60x60,即 7 小時,根據自己的需要修改即可。如果每天都要修改步數,那么讓程序一直保持運行即可。
注意:運行程序會立刻修改當天的步數,自動修改步數是從程序保持運行的第二天開始。
部分源碼,全部源碼獲取方式見文末
#?-*-?coding:?utf-8?-*-
import?requests
import?json
import?hashlib
import?time
import?datetime
class?LexinSport:
????def?__init__(self,?username,?password,?step):
????????self.username?=?username
????????self.password?=?password
????????self.step?=?step
????#?登錄
????def?login(self):
????????url?=?'https://sports.lifesense.com/sessions_service/login?systemType=2&version=4.6.7'
????????data?=?{'loginName':?self.username,?'password':?hashlib.md5(self.password.encode('utf8')).hexdigest(),
????????????????'clientId':?'49a41c9727ee49dda3b190dc907850cc',?'roleType':?0,?'appType':?6}
????????headers?=?{
????????????'Content-Type':?'application/json;?charset=utf-8',
????????????'User-Agent':?'Dalvik/2.1.0?(Linux;?U;?Android?7.1.2;?LIO-AN00?Build/LIO-AN00)'
????????}
????????response_result?=?requests.post(url,?data=json.dumps(data),?headers=headers)
????????status_code?=?response_result.status_code
????????response_text?=?response_result.text
????????# print('登錄狀態碼:%s'?% status_code)
????????# print('登錄返回數據:%s'?% response_text)
????????if?status_code?==?200:
????????????response_text?=?json.loads(response_text)
????????????user_id?=?response_text['data']['userId']
????????????access_token?=?response_text['data']['accessToken']
????????????return?user_id,?access_token
????????else:
????????????return?'登錄失敗'
????#?修改步數
????def?change_step(self):
????????#?登錄結果
????????login_result?=?self.login()
????????if?login_result?==?'登錄失敗':
????????????return?'登錄失敗'
????????else:
????????????url?=?'https://sports.lifesense.com/sport_service/sport/sport/uploadMobileStepV2?systemType=2&version=4.6.7'
????????????data?=?{'list':?[{'DataSource':?2,?'active':?1,?'calories':?int(self.step/4),?'dataSource':?2,
??????????????????????????????'deviceId':?'M_NULL',?'distance':?int(self.step/3),?'exerciseTime':?0,?'isUpload':?0,
??????????????????????????????'measurementTime':?time.strftime('%Y-%m-%d?%H:%M:%S'),?'priority':?0,?'step':?self.step,
??????????????????????????????'type':?2,?'updated':?int(round(time.time()?*?1000)),?'userId':?login_result[0]}]}
????????????headers?=?{
????????????????'Content-Type':?'application/json;?charset=utf-8',
????????????????'Cookie':?'accessToken=%s'?%?login_result[1]
????????????}
????????????response_result?=?requests.post(url,?data=json.dumps(data),?headers=headers)
????????????status_code?=?response_result.status_code
????????????#?response_text?=?response_result.text
????????????# print('修改步數狀態碼:%s'?% status_code)
????????????# print('修改步數返回數據:%s'?% response_text)
????????????if?status_code?==?200:
????????????????return?'修改步數為【%s】成功'?%?self.step
????????????else:
????????????????return?'修改步數失敗'
#?睡眠到第二天執行修改步數的時間
def?get_sleep_time():
????#?第二天日期
????tomorrow?=?datetime.date.today()?+?datetime.timedelta(days=1)
????#?第二天7點時間戳
????tomorrow_run_time?=?int(time.mktime(time.strptime(str(tomorrow),?'%Y-%m-%d')))?+?25200
????#?print(tomorrow_run_time)
????#?當前時間戳
????current_time?=?int(time.time())
????#?print(current_time)
????return?tomorrow_run_time?-?current_time
if?__name__?==?"__main__":
????#?最大運行出錯次數
????fail_num?=?3
????while?1:
????????while?fail_num?>?0:
????????????try:
????????????????#?修改步數結果
????????????????result?=?LexinSport('樂心健康賬號',?'樂心健康密碼',?修改步數).change_step()
????????????????print(result)
????????????????break
????????????except?Exception?as?e:
????????????????print('運行出錯,原因:%s'?%?e)
????????????????fail_num?-=?1
????????????????if?fail_num?==?0:
????????????????????print('修改步數失敗')
????????#?重置運行出錯次數
????????fail_num?=?3
????????#?獲取睡眠時間
????????sleep_time?=?get_sleep_time()
????????time.sleep(sleep_time)
推薦閱讀
(點擊標題可跳轉閱讀)
源碼及相關文件在公眾號后臺回復?
步數
?獲取。用 Python 修改微信(支付寶)運動步數,輕松 TOP1
今天分享的文章讓你霸屏微信運動,橫掃支付寶榜單
項目意義
如果你想在支付寶螞蟻森林收集很多能量種樹,為環境綠化出一份力量,又或者是想每天稱霸微信運動排行榜裝逼,卻不想出門走路,那么該 python 腳本可以幫你實現。
實現方法
手機安裝第三方軟件樂心健康,注冊賬號登錄,將運動數據同步到微信和支付寶。用 python 腳本遠程修改樂心健康當前登錄賬號的步數即可。
第一步:在手機上安裝樂心健康 app。
安卓版下載地址: ( )
蘋果版下載地址:( )
第二步:注冊賬號登錄,并設置登錄密碼。
第三步:完成第三方同步,將運動數據同步到微信和支付寶。
第四步:運行 python 腳本,修改樂心健康步數。
python 代碼
程序設定是每天 7 點自動修改步數,在下面腳本對應的位置替換填入樂心健康賬號、樂心健康密碼、修改步數,然后運行程序。修改步數推薦設置范圍是 30000 至 90000,步數值太大會導致修改不成功。如果想改變第二天自動修改步數的時間,請修改圖示位置的 25200,+25200 代表第二天 0 點后加上的秒數,也就是 7x60x60,即 7 小時,根據自己的需要修改即可。如果每天都要修改步數,那么讓程序一直保持運行即可。
注意:運行程序會立刻修改當天的步數,自動修改步數是從程序保持運行的第二天開始。
部分源碼:
#?-*-?coding:?utf-8?-*-
import?requests
import?json
import?hashlib
import?time
import?datetime
class?LexinSport:
????def?__init__(self,?username,?password,?step):
????????self.username?=?username
????????self.password?=?password
????????self.step?=?step
????#?登錄
????def?login(self):
????????url?=?'https://sports.lifesense.com/sessions_service/login?systemType=2&version=4.6.7'
????????data?=?{'loginName':?self.username,?'password':?hashlib.md5(self.password.encode('utf8')).hexdigest(),
????????????????'clientId':?'49a41c9727ee49dda3b190dc907850cc',?'roleType':?0,?'appType':?6}
????????headers?=?{
????????????'Content-Type':?'application/json;?charset=utf-8',
????????????'User-Agent':?'Dalvik/2.1.0?(Linux;?U;?Android?7.1.2;?LIO-AN00?Build/LIO-AN00)'
????????}
????????response_result?=?requests.post(url,?data=json.dumps(data),?headers=headers)
????????status_code?=?response_result.status_code
????????response_text?=?response_result.text
????????# print('登錄狀態碼:%s'?% status_code)
????????# print('登錄返回數據:%s'?% response_text)
????????if?status_code?==?200:
????????????response_text?=?json.loads(response_text)
????????????user_id?=?response_text['data']['userId']
????????????access_token?=?response_text['data']['accessToken']
????????????return?user_id,?access_token
????????else:
????????????return?'登錄失敗'
????#?修改步數
????def?change_step(self):
????????#?登錄結果
????????login_result?=?self.login()
????????if?login_result?==?'登錄失敗':
????????????return?'登錄失敗'
????????else:
????????????url?=?'https://sports.lifesense.com/sport_service/sport/sport/uploadMobileStepV2?systemType=2&version=4.6.7'
????????????data?=?{'list':?[{'DataSource':?2,?'active':?1,?'calories':?int(self.step/4),?'dataSource':?2,
??????????????????????????????'deviceId':?'M_NULL',?'distance':?int(self.step/3),?'exerciseTime':?0,?'isUpload':?0,
??????????????????????????????'measurementTime':?time.strftime('%Y-%m-%d?%H:%M:%S'),?'priority':?0,?'step':?self.step,
??????????????????????????????'type':?2,?'updated':?int(round(time.time()?*?1000)),?'userId':?login_result[0]}]}
????????????headers?=?{
????????????????'Content-Type':?'application/json;?charset=utf-8',
????????????????'Cookie':?'accessToken=%s'?%?login_result[1]
????????????}
????????????response_result?=?requests.post(url,?data=json.dumps(data),?headers=headers)
????????????status_code?=?response_result.status_code
????????????#?response_text?=?response_result.text
????????????# print('修改步數狀態碼:%s'?% status_code)
????????????# print('修改步數返回數據:%s'?% response_text)
????????????if?status_code?==?200:
????????????????return?'修改步數為【%s】成功'?%?self.step
????????????else:
????????????????return?'修改步數失敗'
#?睡眠到第二天執行修改步數的時間
def?get_sleep_time():
????#?第二天日期
????tomorrow?=?datetime.date.today()?+?datetime.timedelta(days=1)
????#?第二天7點時間戳
????tomorrow_run_time?=?int(time.mktime(time.strptime(str(tomorrow),?'%Y-%m-%d')))?+?25200
????#?print(tomorrow_run_time)
????#?當前時間戳
????current_time?=?int(time.time())
????#?print(current_time)
????return?tomorrow_run_time?-?current_time
if?__name__?==?"__main__":
????#?最大運行出錯次數
????fail_num?=?3
????while?1:
????????while?fail_num?>?0:
????????????try:
????????????????#?修改步數結果
????????????????result?=?LexinSport('樂心健康賬號',?'樂心健康密碼',?修改步數).change_step()
????????????????print(result)
????????????????break
????????????except?Exception?as?e:
????????????????print('運行出錯,原因:%s'?%?e)
????????????????fail_num?-=?1
????????????????if?fail_num?==?0:
????????????????????print('修改步數失敗')
????????#?重置運行出錯次數
????????fail_num?=?3
????????#?獲取睡眠時間
????????sleep_time?=?get_sleep_time()
????????time.sleep(sleep_time)最近有有不少老鐵在后臺留言說,想進大廠,但是算法不好。最近我整理了一份刷題實錄,這份刷題實錄,也讓我進了心儀的大廠。現在開放分享給大家。希望對大家有所幫助。 任何的算法題,如同寫作文一樣,都有一些模板可以套用的。比如面試常考的DP(動態規劃),難的是一些關鍵點是否能想清楚。比如你能寫出動態轉移方程,這題基本上就可以AC了。 整個刷題實錄內容,包括?雙子針、動態規劃、二分查找、貪心算法、深度優先搜索、字符串、遞歸、字典樹、排序、鏈表等相關專題內容。圖文并茂,附有刷題答案源碼。 刷題任務的題目,是根據題目的類型來匯總的,總結了八個類別,每個類別下面也總結了5個左右的題型,幫助大家分門別類的突破,所以刷起來相對會更有重點和針對性。如果從頭到尾的刷,每周按順序刷42題,很容易讓自己堅持不下來,也會覺得很枯燥。所以在制定計劃的時候可以讓這個計劃變得更“有趣"和針對性,讓它看起來更容易實現一點,才會更容易堅持。 目前上述內容已打包成完整電子書,具體獲取方式如下:
掃描關注 Github愛好者社區 公眾號;
在 Github愛好者社區 公眾號后臺回復關鍵詞「9999」獲取下載地址。
掃描關注,回復"9999"即可下載 最近熱文
? 17歲女生研究大閘蟹上熱搜!網友看完酸了…… ???棄用 Notepad++,還有 5 款更牛逼的選擇! ???面試官:為什么 HashMap 的加載因子是0.75? ???“AI一鍵脫衣”,又卷土重來了! 長按二維碼?2 秒 在公眾號后臺回復「Java」 獲取最新整理的6000頁Java學習筆記
明天見(??ω??)