def add_friend(msg): itchat.add_friend(**msg['Text']); itchat.get_contract(); itchat.send(u'我是小书童,终于等到愿意改变的你,从今天开始你就是我的主人了,有什么吩咐尽快说!', msg['RecommendInfo']['UserName']); time.sleep(5); itchat.send(u'主人,为了能陪你完成读书的计划,偶们需要完成一个小任务获得共读的资格和电子书资源。将小的发的图片分享到朋友圈然后截图发给小的。然后我们就可以一起去群里完成每日的读书计划,群内每天都有小的发的领读。小的一直会伴你读书,陪你成长!', msg['RecommendInfo']['UserName']); # itchat.send_image('@[email protected]' , msg['RecommendInfo']['UserName']); return '@[email protected]';
def add_friend(msg): itchat.add_friend(**msg['Text']) itchat.get_contract() itchat.send(u'我是小书童,终于等到愿意改变的你,从今天开始你就是我的主人了,有什么吩咐尽快说!', msg['RecommendInfo']['UserName']) time.sleep(5) itchat.send( u'主人,为了能陪你完成读书的计划,偶们需要完成一个小任务获得共读的资格和电子书资源。将小的发的图片分享到朋友圈然后截图发给小的。然后我们就可以一起去群里完成每日的读书计划,群内每天都有小的发的领读。小的一直会伴你读书,陪你成长!', msg['RecommendInfo']['UserName']) # itchat.send_image('@[email protected]' , msg['RecommendInfo']['UserName']); return '@[email protected]'
def main(): parent_dir = get_parent_path() image_dir = parent_dir + "\\" + "images" image_dict = get_user_img(image_dir) fail_lst = [] itchat.auto_login() contract = itchat.get_contract() for user, image in image_dict.items(): user_name, quan_pin = get_user_name(user, contract) if not user_name or not quan_pin: # 好友列表不存在 fail_lst.append(user) log.debug(u"%s 的工资条发送失败!" % user) continue temp_path = parent_dir + "\\" + quan_pin + "." + image.split(".")[1] # 中文图片移到上级目录, 改名为拼音 shutil.move(image, temp_path) if itchat.send_image(temp_path, user_name): log.debug(u"%s 的工资条发送成功!" % user) os.remove(temp_path) # 删除临时文件 else: fail_lst.append(user) log.debug(u"%s 的工资条发送失败!" % user) log.debug(u"成功发送 %s 条工资信息" % (len(image_dict) - len(fail_lst))) if fail_lst: log.debug(u"%s 条发送失败, 名单如下" % len(fail_lst)) for i in fail_lst: log.debug(i) os.startfile(image_dir)
def get_contact(update=False): ''' fetch part of contact for part - all the massive platforms and friends are fetched - if update, only starred chatrooms are fetched for options - update: if not set, local value will be returned for results - chatroomList will be returned it is defined in components/contact.py ''' return itchat.get_contract(update)
def Login(uuid): waitForConfirm = False while True: status = itchat.check_login(uuid) if status=='200': break elif status=='201': if waitForConfirm: LogCat("Plase press confrim ....") waitForConfirm=True elif status == '408': LogCat("Reloading QR code....") uuid = getUUID() print uuid getQR(uuid) waitForConfirm = False itchat.web_init() itchat.show_mobile_login() itchat.get_contract() contract = itchat.get_contractTest() itchat.start_receiving()#key print contract return contract
def add_friend(msg): itchat.add_friend(**msg['Text']); itchat.get_contract(); itchat.send(u'亲\n\n请输入你的七夕密语,以@开头,如:\n\n@静静我爱你\n\n最少4个字,至多24字\n\n回复『 1 』,获取密语答案', msg['RecommendInfo']['UserName']);
def add_friend(msg): itchat.add_friend(**msg['Text']) itchat.get_contract() itchat.send('Nice to meet you!', msg['RecommendInfo']['UserName'])
uuid = open_QR() waitForConfirm = False while 1: status = itchat.check_login(uuid) if status == '200': break elif status == '201': if waitForConfirm: output_info('Please press confirm') waitForConfirm = True elif status == '408': output_info('Reloading QR Code') uuid = open_QR() waitForConfirm = False userInfo = itchat.web_init() itchat.show_mobile_login() itchat.get_contract() output_info('Login successfully as %s' % userInfo['NickName']) itchat.start_receiving() # Start auto-replying @itchat.msg_register def simple_reply(msg): if msg['Type'] == 'Text': return 'I received: %s' % msg['Content'] itchat.run()
def add_friend(msg): itchat.add_friend(**msg['Text']) itchat.get_contract() itchat.send(u'请输入你的出生日期,如: 20150908', msg['RecommendInfo']['UserName'])
def add_friend(msg): itchat.add_friend(**msg['Text']) itchat.get_contract() itchat.send(u'爱奇艺VIP 账号13539956455 密码fujoshi123\n\n爱奇艺VIP 账号13873248477 密码jiro201151\n\n爱奇艺VIP 账号15912592375 密码zxc521523\n\n爱奇艺VIP 账号18657196137 密码gmail.com\n\n爱奇艺VIP 账号18629016101 密码slh8023.\n\n爱奇艺VIP 账号18574303268 密码ting1314520\n\n爱奇艺VIP 账号18620300513 密码sammie123\n\n爱奇艺VIP 账号15008159500 密码jxm19880713\n\n爱奇艺VIP 账号18215523978 密码8298290\n\n爱奇艺VIP 账号15153768558 密码zhang523\n\n亲~这些都是我辛苦收集来的哦。不能登的。晚些收集后还会更新,多留意哦。', msg['RecommendInfo']['UserName'])
# -*- coding:utf-8 -*- import itchat import re import matplotlib.pyplot as plt from wordcloud import WordCloud,STOPWORDS,ImageColorGenerator import os import numpy as np import PIL.Image as Image import jieba # 登录 itchat.auto_login() # 获取好友列表 friends = itchat.get_contract(update=True)[0:] # 初始化计数器,有男有女,当然,有些人是不填的 ''' male = female = other = 0 # 遍历这个列表,列表里第一位是自己,所以从"自己"之后开始计算 # 1表示男性,2女性 sig=[] for i in friends[1:]: sig.append(i["Signature"]) sex=i["Sex"] if sex == 1: male += 1 elif sex == 2: female += 1 else: other+=1 # 总数算上,好计算比例啊~ total = len(friends[1:])
def add_friend(msg): itchat.add_friend(**msg['Text']) itchat.get_contract() itchat.send('Nice to meet you! 我是小薇机器人 输入#CHANGEMODEL=1可唤醒我', msg['RecommendInfo']['UserName'])