博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
微博群发私信
阅读量:6651 次
发布时间:2019-06-25

本文共 3203 字,大约阅读时间需要 10 分钟。

1 import requests 2 import json 3 import time 4 url = 'http://weibo.com/aj/message/add?ajwvr=6' 5 headers = { 6     'User-Agent':'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.22 Safari/537.36 SE 2.X MetaSr 1.0', 7 'Referer':'http://weibo.com/message/history?uid=2186989853&name=ROY_zhc', 8     'Cookie':'SINAGLOBAL=5450357842753.007.1478158728462; __gads=ID=dc8a0460ce5af255:T=1489578899:S=ALNI_MYrN6m9721fFYGIaxBwegZ9ByUO1g; wvr=6; TC-V5-G0=7975b0b5ccf92b43930889e90d938495; SCF=ApzT2KV9xmTEjJUK4YRFlJExEX9fmOOwdl9nhqIuUVD_OhWU87Hd4w0sm_KUG1jz9vx5C428gy733JfN4JEf0c4.; SUB=_2A251231eDeRhGeNG7lsX8CnOyziIHXVWkemWrDV8PUNbmtAKLUTdkW8ouHLwUbmX2qOzUi0mLFzBKNnKVw..; SUBP=0033WrSXqPxfM725Ws9jqgMF55529P9D9Wh_9o.MhDTX6AFesEjyWUKb5JpX5KMhUgL.Fo-RSK.cehMEehB2dJLoIEBLxKBLB.qLB.2LxK-LBo5L12qLxK-LBKqLB--LxK-L1hBLB.qt; SUHB=0z1ATn2tTI1217; ALF=1522548878; SSOLoginState=1491012878; _s_tentry=login.sina.com.cn; Apache=2395084912998.7793.1491012947796; ULV=1491012948399:136:1:9:2395084912998.7793.1491012947796:1490950378226; UOR=,,login.sina.com.cn; TC-Page-G0=07e0932d682fda4e14f38fbcb20fac81; TC-Ugrow-G0=370f21725a3b0b57d0baaf8dd6f16a18' 9 }10 13     for i in f:14         data = {15         'location':'msgdialog',16         'module':'msgissue',17         'style_id':'1',18         'text':'''私信内容19         ''',20         'uid':i.strip(),21         'tovfids':'',22         'fids':'',23         'el':'[object HTMLDivElement]',24         '_t:0':'0'25         }26         try:27             res = requests.post(url,data,headers=headers)28             a = json.loads(res.text)['msg']29             if '恭喜' in a:30                 print(a)31             else:32                 print(a + i)33         except Exception as e:34             print(e,i)

 

import requestsimport jsonimport timeurl = 'https://m.weibo.cn/msgDeal/sendMsg?'headers = {'User-Agent':'Mozilla/5.0 (Linux; Android 5.0; SM-G900P Build/LRX21T) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Mobile Safari/537.36','Cookie':'h5_deviceID=318a38391533b96b5e211f15bb109557; _T_WM=10f6881b13fd68fbcb3a458488e39054; ALF=1506591056; SCF=AjVnYn5w5MVRKBChxLVFcVRWP9YlRAZbNSb6l1VItKaZPbPmM8hXn5b7FrZw5z8Lf3B1g3Lc1TpPD-T5K5kuPwk.; SUB=_2A250oUQBDeRhGeVM6lIU8izEwjyIHXVUamxJrDV6PUJbktANLWLBkW2FvlLLJYotPvkFSGUkDvw1ujdEIg..; SUBP=0033WrSXqPxfM725Ws9jqgMF55529P9D9WhQMFyM94ynlSl9JBZenkS15JpX5o2p5NHD95Q0eo27SKzE1h.7Ws4DqcjZxPiDqcj_K2v1x7tt; SUHB=0rr7vHua1adtw0; SSOLoginState=1503999057; H5_INDEX=1; H5_INDEX_TITLE=Erick-LONG; M_WEIBOCN_PARAMS=featurecode%3D20000320%26luicode%3D20000174%26lfid%3Dhotword','Referer':'https://m.weibo.cn/msg/chat?uid=6019902350',}with open('biangxx.txt','r') as f:    falied = []    for i in f:        data = {        'fileId':'null',        'uid':i.strip(),        'content':'''xx''',        'st':'10578d'        }        try:            res = requests.post(url,data,headers=headers)            a = json.loads(res.text)['msg']            if '成功' in a:                print(a)            else:                falied.append(i)        except Exception as e:            print(e)            falied.append(i)    print(falied)

 

转载于:https://www.cnblogs.com/Erick-L/p/6733142.html

你可能感兴趣的文章
最新apache+svn+reviewboard实现在线代码评审
查看>>
zimbra 邮件服务器管理
查看>>
mysql 常见的备份架构及技术
查看>>
SAS vs SSD对比测试MySQL tpch性能
查看>>
感受Windows Aero的至佳体验
查看>>
常用思科设备图标(JPG+矢量图)
查看>>
Redis主从持久化测试
查看>>
DOCKER网络代理设置
查看>>
Xamarin 学习笔记 - Page(页面)
查看>>
Azure运维系列 8:使用现有磁盘创建虚拟机
查看>>
Spread for Windows Forms高级主题(8)---通过暂停布局提高性能
查看>>
SaltStack入门(二)Grains、NoteGroup和State
查看>>
Android系统的开机画面显示过程分析(11)
查看>>
统一沟通-技巧-6-Jeff Schertz-博文-地址-汇总-2011-04-08
查看>>
powershell命令大全
查看>>
Windows Server 2012 从入门到精通系列之如何提高DC持续性?
查看>>
Android应用程序键盘(Keyboard)消息处理机制分析(6)
查看>>
skullsecurity作者常用的一些linux命令
查看>>
系统集成工程师--想说爱你不容易
查看>>
同质化严重,手机智能化发展方向今安在?
查看>>