Exemplo n.º 1
0
    def prepare_phone(self):
        num = self.ctx.getPropsHelper().get_property("ftid", None)
        passwd = self.ctx.getPropsHelper().get_property("ftps", None)

        # phone = PyFetion(mobile_no,passwd,"TCP",debug="FILE")
        phone = PyFetion(num, passwd, "HTTP", debug="FILE")
        try:
            ret = phone.login(FetionHidden)
        except PyFetionSupportError, e:
            self.printl("手机号未开通飞信")
            return 1
Exemplo n.º 2
0
def main(argv=None):

    mobile_no = raw_input(toEcho("手机号:"))
    passwd = getpass(toEcho("口  令:"))

    phone = PyFetion(mobile_no, passwd, "TCP", debug="FILE")
    try:
        t = progressBar()
        t.start()
        #可以在这里选择登录的方式[隐身 在线 忙碌 离开]
        ret = phone.login(FetionOnline)
    except PyFetionSupportError, e:
        printl("手机号未开通飞信")
        return 1
Exemplo n.º 3
0
def main(argv=None):

    mobile_no = raw_input(toEcho("手机号:"))
    passwd = getpass(toEcho("口  令:"))

    phone = PyFetion(mobile_no, passwd, "TCP", debug="FILE")
    try:
        t = progressBar()
        t.start()
        # 可以在这里选择登录的方式[隐身 在线 忙碌 离开]
        ret = phone.login(FetionOnline)
    except PyFetionSupportError, e:
        printl("手机号未开通飞信")
        return 1
Exemplo n.º 4
0
def main(argv=None):
    
    mobile_no = '15801631679'
    passwd = '731849lara4'

    phone = PyFetion(mobile_no,passwd,"TCP",debug="FILE")
    try:
        t = progressBar()
        t.start()
        #可以在这里选择登录的方式[隐身 在线 忙碌 离开]
        ret = phone.login(FetionOnline)
    except PyFetionSupportError,e:
        printl("手机号未开通飞信")
        return 1
Exemplo n.º 5
0
def main(argv=None):
    
    #mobile_no = raw_input(toEcho("手机号:"))
    #passwd = getpass(toEcho("口  令:"))
    
    mobile_no = '13581927326'
    passwd = 'sun71716169'

    #phone = PyFetion(mobile_no,passwd,"TCP",debug="FILE")
    phone = PyFetion(mobile_no,passwd,"HTTP",debug="FILE")
    try:
        ret = phone.login(FetionHidden)
    except PyFetionSupportError,e:
        printl("手机号未开通飞信")
        return 1
Exemplo n.º 6
0
class FetionClient:
	def __init__(self, mobile_num, password):
		self.phone = PyFetion(mobile_num,password,"HTTP",debug=False)
		FetionLogin(self.phone)
	def sendMessage(self, receiver, message):
		print('trying to send message to %s:(%s)'%(receiver,message))
		if receiver==None or receiver=='self' or receiver=='me':
			if self.phone.send_sms(toUTF8(message)):
				print("message sent")
			else:
				print("error sending message")
			return
		if not receiver.isdigit() or receiver.isdigit() and len(receiver)!=11: 
			# sending to a name
			contactlist = copy(self.phone.contactlist)

			for i in contactlist:
				if contactlist[i][0] == '':
					contactlist[i][0] = i[4:4+9]
			for c in contactlist.items():
				if c[1][0] == receiver:
					to = c[0]
					if self.phone.send_sms(toUTF8(message),to):
						print("message sent")
					else:
						print("error sending message")
					return 
			print("cannot find name %s" % receiver)
			return
		#send to a number
		contactlist = copy(self.phone.contactlist)
		to=''
		for c in contactlist.items():
			if c[1][1] == receiver:
				to = c[0]
		if not to:
			print("the number is not friend")
			return
		if self.phone.send_sms(toUTF8(message),to):
			print("message sent")
		else:
			print("error sending message")
Exemplo n.º 7
0
def main(argv=None):
    if not argv:
        return

    global config_file
    mobile_no = ''
    passwd    = ''
    target    = None
    msg       = ''

    config_file = argv[0].replace('fetion.py', config_file)
    config = FetionConfig()
    if config.Load(config_file):
        mobile_no = config.loginuser
        passwd    = config.loginpass

    if len(argv) == 3:
        mobile_no = argv[1]
        passwd    = argv[2]
    elif len(argv) == 5:
        mobile_no = argv[1]
        passwd    = argv[2]
        target    = argv[3].lower()
        msg       = argv[4]

    if len(mobile_no)==0:
        mobile_no = raw_input(toEcho("手机号/飞信号:"))

    if len(passwd) == 0:
        passwd = getpass(toEcho("口  令:"))

    phone = PyFetion(mobile_no,passwd,"HTTP",debug="FILE")
    try:
        t = progressBar()
        t.start()
        #可以在这里选择登录的方式[隐身 在线 忙碌 离开]
        ret = phone.login(FetionOnline)
    except PyFetionSupportError,e:
        printl("手机号未开通飞信")
        return 1
Exemplo n.º 8
0
def login():
    '''登录设置'''
    global mobile_no
    if len(sys.argv) > 3:
        print u'参数错误'
    elif len(sys.argv) == 3:
        mobile_no = sys.argv[1]
        passwd = sys.argv[2]
    else:
        if len(sys.argv) == 2:
            mobile_no = sys.argv[1]
        elif len(sys.argv) == 1:
            try:
                confile = open(config_file, 'r')
                lines = confile.readlines()
                for line in lines:
                    if line.startswith("#"):
                        continue
                    if line.startswith("tel"):
                        mobile_no = line.split("=")[1][:-1]
                    elif line.startswith("password"):
                        passwd = line.split("=")[1]
                phone = PyFetion(mobile_no, passwd, "TCP", debug="FILE")
                return phone
            except:
                mobile_no = raw_input(toEcho("手机号:"))
        passwd = getpass(toEcho("口  令:"))
        save = raw_input(toEcho("是否保存手机号和密码以便下次自动登录(y/n)?"))
        if save == 'y':
            confile = open(config_file, 'w')
            content = "#该文件由pyfetion生成,请勿随意修改\n"
            content = content + "tel=" + mobile_no
            content = content + "\npassword="******"TCP", debug="FILE")
    return phone
Exemplo n.º 9
0
class sendSMSTask():
    def __init__(self):
        self.smsConnection=None
    
    def login(self,phoneNumber,passWord):
        print 'SMS login...'
        self.smsConnection=PyFetion(phoneNumber,passWord,'TCP',debug=False)
        self.smsConnection.login(FetionOnline)
        
    def sendSMS(self,message):
        print 'Send one SMS at time %s'%(time.strftime('%Y-%m-%d:%H:%M:%S',time.localtime(time.time())))
        self.smsConnection.send_sms(message)
        
    def logout(self):
        print 'SMS logout...'
        self.smsConnection.logout()
Exemplo n.º 10
0
def sendSMS(phone_num,passwd,data):
    fetion = PyFetion(phone_num,passwd,'HTTP')
    i = 0
    fetion.login(FetionOnline)
    fetion.send_sms(data)
    fetion.logout()
Exemplo n.º 11
0
# -*- coding: utf-8 -*-
from PyFetion import * 

p=PyFetion("13436802517","laoding@1812")
p.login()

#print p.send_sms(u"膜拜阿!!!!".encode('utf-8'),to="15210956320")
#print p.send_msg(u"法111".encode('utf-8'),to="15210956320")
#p.logout()
Exemplo n.º 12
0
 def login(self,phoneNumber,passWord):
     print 'SMS login...'
     self.smsConnection=PyFetion(phoneNumber,passWord,'TCP',debug=False)
     self.smsConnection.login(FetionOnline)
Exemplo n.º 13
0
	def __init__(self, mobile_num, password):
		self.phone = PyFetion(mobile_num,password,"HTTP",debug=False)
		FetionLogin(self.phone)