| 注册
请输入搜索内容

热门搜索

Java Linux MySQL PHP JavaScript Hibernate jQuery Nginx

Python 调取短信验证码平台---创蓝253云通讯平台

0
Python C/C++ Go 4105 次浏览

#!/usr/local/bin/python
#-*- coding:utf-8 -*-
# Author: jacky
# Time: 14-2-22 下午11:48
# Desc: 短信http接口的python代码调用示例
import httplib
import urllib

#服务地址
host = "sms.253.com"

#端口号
port = 80

#版本号
version = "v1.1"

#查账户信息的URI
balance_get_uri = "/msg/balance"

#智能匹配模版短信接口的URI
sms_send_uri = "/msg/send"

#创蓝253账号
un  = "xxxx"

#创蓝密码
pw = "xxxx"

def get_user_balance():
    """
    取账户余额
    """
    conn = httplib.HTTPConnection(host, port=port)
    conn.request('GET', balance_get_uri + "?un=" + un + "&pw=" + pw)
    response = conn.getresponse()
    response_str = response.read()
    conn.close()
    return response_str

def send_sms(text, phone):
    """
    能用接口发短信
    """
    params = urllib.urlencode({'un': un, 'pw' : pw, 'msg': text, 'phone':phone, 'rd' : '1'})
    headers = {"Content-type": "application/x-www-form-urlencoded", "Accept": "text/plain"}
    conn = httplib.HTTPConnection(host, port=port, timeout=30)
    conn.request("POST", sms_send_uri, params, headers)
    response = conn.getresponse()
    response_str = response.read()
    conn.close()
    return response_str 

if __name__ == '__main__':

    phone = "188xxxxxxxx"
    text = "【创蓝253云通讯】您的验证码是1234"

    #查账户余额
    print(get_user_balance())

    #调用智能匹配模版接口发短信
    print(send_sms(text, phone))

 

 

50个答案

0

They're pressed into a thick layer of the resin, which provides a smooth base for your driveway and a permeable upper surface to prevent puddles and water issues. you could try this outclick here for more

 

0

Thank you for producing such a fascinating essay on this subject. This has sparked a lot of thought in me, and I'm looking forward to reading more. getting over it

0

From your article, students get help to do their projects easily. From us, you can avail Professional Floor installation Services Chicago IL which can provide you with customized solutions for your needs.

0

Your article is very helpful, the topic is particularly interesting, thanks for conveying it to us, keep it up.

poppy playtime

0

Great job for publishing such a beneficial web site. Your web log isn’t only useful but
it is additionally really creative too
.best smm panel

0

Is that your picture next to "charming" in the dictionary?https://doulasbayarea.com

0

I wanna know more about this because this is really informative!

 

microblading brows

0

I highly appreciate your work here! Thank you so much!

permanent eyebrows

0

I love your content! Great job!

microblading eyebrows near me

0

I really loved it here but are there any recent updates? Thanks  https://weldingportlandor.com

0

 Nice blog and absolutely outstanding.  You can do something much better but i still say this perfect. Keep trying for the best.  lawn companies near me

0

一个拉我的字符串 financialadvisorstockton.com

0

她偷了他的狗,用它的关键石灰绿色 kitchenremodelingriversideca.com

0

即使它只是在你最疯狂的梦想中 doulasbayarea.com

0

Great post but I was wondering if you could write a little more on this subject? I’d be very thankful if you could elaborate a little bit further. Thanks in advance! Daisy

0

We are really grateful for your blog post. You will find a lot of approaches after visiting your post. I was exactly searching for. Thanks for such post and please keep it up. Great work. -Hillary

0

thank you for this! really appreciate you doing this boudoirphotographymemphis.com

0

great site admin thanks for posting this great blog i love it please send me some email! sandblasting job

0

CONTACT US FOR SEXY MODELS/ESCORTS/CALL GIRLS Agra Escorts Akola Escorts Aligarh Escorts Allahabad Escorts Amravati Escorts Amritsar Escorts Bareilly Escorts Belgaum Escorts Bhavnagar Escorts Bhilai Escorts Bhiwandi Escorts Bhopal Escorts Bhubaneswar Escorts Bikaner Escorts Bokaro Escorts Chandigarh Escorts Cuttack Escorts Daman Escorts Dehradun Escorts Durgapur Escorts Erode Escorts Faridabad Escorts Gangtok Escorts Gorakhpur Escorts Gulbarga Escorts Guntur Escorts Guwahati Escorts Gwalior Escorts Howrah Escorts Hubli Escorts Hyderabad Escorts Indore Escorts Itanagar Escorts Jabalpur Escorts Jaipur Escorts Jalandhar Escorts Jhansi Escorts Jodhpur Escorts Kakinada Escorts Kalyan-Dombivali Escorts Kochi Escorts Kolhapur Escorts Kozhikode Escorts Kurnool Escorts Loni Escorts Lucknow Escorts Ludhiana Escorts Madurai Escorts Maheshtala Escorts Malegaon Escorts Mangalore Escorts Meerut Escorts Mysore Escorts Nagpur Escorts Nanded Escorts Nashik Escorts Nellore Escorts Kolkata Escorts Panaji Escorts Patiala Escorts Pimpri-Chinchwad Escorts Port Blair Escorts Raipur Escorts Rajahmundry Escorts Rajkot Escorts Ranchi Escorts Rourkela Escorts Saharanpur Escorts Salem Escorts Sangli Escorts Shillong Escorts Shimla Escorts Siliguri Escorts Silvassa Escorts Solapur Escorts South Dumdum Escorts Sri Ganganagar Escorts Srinagar Escorts Surat Escorts Trivandrum Escorts Udaipur Escorts Ulhasnagar Escorts Vadodara Escorts Varanasi Escorts Vijayawada Escorts Visakhapatnam Escorts Warangal Escorts Vapi Escorts Ujjain Escorts Agartala Escorts Kanpur Escorts Mumbai Escorts Navi Mumbai Escorts Noida Escorts Pune Escorts Ramagundam Escorts Thane Escorts Vasai-Virar Escorts Ahmedabad Escorts Bangalore Escorts Bellary Escorts Chennai Escorts Coimbatore Escorts Delhi Escorts Dhanbad Escorts Dharwad Escorts Gaya Escorts Gurgaon Escorts Jammu Escorts Pathankot Escorts

0
1 2 3