微信公众平台开发(五) 天气预报功能开发
来源:http://www.cnblogs.com/mchina/p/3170551.html<p></p><div><br></div><div><p style="margin: 10px auto; color: rgb(51, 51, 51); font-family: verdana, Arial, Helvetica, sans-serif; line-height: 25.2px;"><span style="line-height: 1.8; font-size: 16px;"><strong><span style="line-height: 1.8; color: rgb(128, 0, 0);">一、简介</span></strong></span></p><p style="margin: 10px auto; color: rgb(51, 51, 51); font-family: verdana, Arial, Helvetica, sans-serif; line-height: 25.2px;">前面几篇文章对微信公众平台的开通及简单使用做了简单的介绍,但都没有涉及到实际使用中的问题,例如天气查询,公交查询,快递查询等。接下来的几篇文章将对实际生活中会经常使用到的一些功能进行开发讲解,以供读者参考。</p><p style="margin: 10px auto; color: rgb(51, 51, 51); font-family: verdana, Arial, Helvetica, sans-serif; line-height: 25.2px;">这一篇文章将对大家每天都会关心的天气查询进行开发,例如,用户发送消息 “苏州天气”,则会返回苏州实时天气状况,以及未来两天甚至未来五天的天气状况。</p><p style="margin: 10px auto; color: rgb(51, 51, 51); font-family: verdana, Arial, Helvetica, sans-serif; line-height: 25.2px;"><span style="line-height: 1.8; font-size: 16px;"><strong><span style="line-height: 1.8; color: rgb(128, 0, 0);">二、思路分析</span></strong></span></p><p style="margin: 10px auto; color: rgb(51, 51, 51); font-family: verdana, Arial, Helvetica, sans-serif; line-height: 25.2px;">首先要对用户发送过来的消息进行判断,判断消息里是否含有“天气”关键字,如果含有,则需要继续提取地区信息,然后再通过中国天气网(<a href="http://www.weather.com.cn/" style="text-decoration: none; color: rgb(0, 0, 0); border-bottom-width: 1px; border-bottom-style: dotted; border-bottom-color: rgb(51, 51, 51);">http://www.weather.com.cn</a>)提供的开放API进行相关地区天气查询。</p><p style="margin: 10px auto; color: rgb(51, 51, 51); font-family: verdana, Arial, Helvetica, sans-serif; line-height: 25.2px;"><span style="line-height: 1.8; font-size: 16px;"><strong><span style="line-height: 1.8; color: rgb(128, 0, 0);">三、关键字判断与地区读取</span></strong></span></p><p style="margin: 10px auto; color: rgb(51, 51, 51); font-family: verdana, Arial, Helvetica, sans-serif; line-height: 25.2px;">用户发送过来查询天气的消息的格式是固定好的,即 “地区+天气”,所以首先截取后两个字,判断是否为 “天气” 关键字。</p><p style="margin: 10px auto; color: rgb(51, 51, 51); font-family: verdana, Arial, Helvetica, sans-serif; line-height: 25.2px;">使用php函数 mb_substr() 截取,关于该函数的用法:</p><div class="cnblogs_code" style="margin-top: 5px; margin-bottom: 5px; padding: 5px; border: 1px solid rgb(204, 204, 204); overflow: auto; color: rgb(0, 0, 0); font-family: "Courier New" !important; font-size: 12px !important; background-color: rgb(245, 245, 245);"><div class="cnblogs_code_toolbar" style="margin-top: 5px;"><span class="cnblogs_code_copy" style="padding-right: 5px; line-height: 1.8;"><a title="复制代码" style="color: rgb(0, 0, 0); border: none !important;"><img src="http://common.cnblogs.com/images/copycode.gif" alt="复制代码" style="max-width: 900px;"></a></span></div><pre style="white-space: pre-wrap; font-family: "Courier New" !important;"><span style="line-height: 1.8;">mb_substr — 获取字符串的部分</span><span style="line-height: 1.8; color: rgb(0, 0, 255);">string</span> mb_substr ( <span style="line-height: 1.8; color: rgb(0, 0, 255);">string</span> <span style="line-height: 1.8; color: rgb(128, 0, 128);">$str</span> , int <span style="line-height: 1.8; color: rgb(128, 0, 128);">$start</span> [, int <span style="line-height: 1.8; color: rgb(128, 0, 128);">$length</span> [, <span style="line-height: 1.8; color: rgb(0, 0, 255);">string</span> <span style="line-height: 1.8; color: rgb(128, 0, 128);">$encoding</span><span style="line-height: 1.8;"> ]] )
<strong>说明:</strong>根据字符数执行一个多字节安全的 </span><span style="line-height: 1.8; color: rgb(0, 128, 128);">substr</span>() 操作。 位置是从 str 的开始位置进行计数。 第一个字符的位置是 0。第二个字符的位置是 1<span style="line-height: 1.8;">,以此类推。
<strong>参数:</strong>
str
从该 </span><span style="line-height: 1.8; color: rgb(0, 0, 255);">string</span><span style="line-height: 1.8;"> 中提取子字符串。
start
str 中要使用的第一个字符的位置。<br>正数 -> 从字符串开头指定位置开始;<br>负数 -> 从字符串结尾指定位置开始;<br>
length
str 中要使用的最大字符数。<br>正数 -> <span style="line-height: 1.8;">从 start </span></span><span style="line-height: 1.8;"><span style="line-height: 1.8;">处开始最多包括 length </span><span style="line-height: 1.8;">个字符;<br>负数 -> string <code class="parameter"></code><span style="line-height: 1.8;">末尾处的 length 个字符将会被漏掉(若 start </span><span style="line-height: 1.8;">是负数则从字符串开头算起)。</span><br></span>
encoding
encoding 参数为字符编码。如果省略,则使用内部字符编码。
<strong>返回值:</strong>
mb_substr() 函数根据 start 和 length 参数返回 str 中指定的部分。</span></pre><div class="cnblogs_code_toolbar" style="margin-top: 5px;"><span class="cnblogs_code_copy" style="padding-right: 5px; line-height: 1.8;"><a title="复制代码" style="color: rgb(0, 0, 0); border: none !important;"><img src="http://common.cnblogs.com/images/copycode.gif" alt="复制代码" style="max-width: 900px;"></a></span></div></div><p style="margin: 10px auto; color: rgb(51, 51, 51); font-family: verdana, Arial, Helvetica, sans-serif; line-height: 25.2px;">$str = mb_substr($keyword,-2,2,"UTF-8");</p><p style="margin: 10px auto; color: rgb(51, 51, 51); font-family: verdana, Arial, Helvetica, sans-serif; line-height: 25.2px;">从消息的结尾数第二个字符开始截取,截取两个字符,然后加以判断是否为 “天气” 关键字。</p><p style="margin: 10px auto; color: rgb(51, 51, 51); font-family: verdana, Arial, Helvetica, sans-serif; line-height: 25.2px;"><span style="line-height: 1.8;">下面进行地区提取,还是使用 </span><span style="line-height: 1.8;">mb_substr() 函数。</span></p><p style="margin: 10px auto; color: rgb(51, 51, 51); font-family: verdana, Arial, Helvetica, sans-serif; line-height: 25.2px;">$str_key = mb_substr($keyword,0,-2,"UTF-8");</p><p style="margin: 10px auto; color: rgb(51, 51, 51); font-family: verdana, Arial, Helvetica, sans-serif; line-height: 25.2px;">从消息的开头开始,截掉末尾的两个字符(天气),既得地区关键字。</p><p style="margin: 10px auto; color: rgb(51, 51, 51); font-family: verdana, Arial, Helvetica, sans-serif; line-height: 25.2px;">然后进行判断,继而调用函数查询天气数据。</p><div class="cnblogs_code" style="margin-top: 5px; margin-bottom: 5px; padding: 5px; border: 1px solid rgb(204, 204, 204); overflow: auto; color: rgb(0, 0, 0); font-family: "Courier New" !important; font-size: 12px !important; background-color: rgb(245, 245, 245);"><pre style="white-space: pre-wrap; font-family: "Courier New" !important;"><span style="line-height: 1.8; color: rgb(0, 0, 255);">if</span>(<span style="line-height: 1.8; color: rgb(128, 0, 128);">$str</span> == '天气' && !empty($str_key)<span style="line-height: 1.8;">)
{
</span><span style="line-height: 1.8; color: rgb(0, 128, 0);">//调用函数查询天气数据</span>
}</pre></div><p style="margin: 10px auto; color: rgb(51, 51, 51); font-family: verdana, Arial, Helvetica, sans-serif; line-height: 25.2px;"><span style="line-height: 1.8; font-size: 16px;"><strong><span style="line-height: 1.5; color: rgb(128, 0, 0);">四、调用 weather() 函数查询</span></strong></span></p><p style="margin: 10px auto; color: rgb(51, 51, 51); font-family: verdana, Arial, Helvetica, sans-serif; line-height: 25.2px;">我们这里调用的是中国国家气象局提供的天气预报API接口,接口地址:http://m.weather.com.cn/data/101190401.html</p><p style="margin: 10px auto; color: rgb(51, 51, 51); font-family: verdana, Arial, Helvetica, sans-serif; line-height: 25.2px;">URL中的数字指代城市的编号101190401(苏州),其他城市对应关系将在下面提供。</p><p style="margin: 10px auto; color: rgb(51, 51, 51); font-family: verdana, Arial, Helvetica, sans-serif; line-height: 25.2px;">该接口<span style="line-height: 1.8;">返回信息比较全面,也是以json格式提供,格式如下:</span></p><div class="cnblogs_code" style="margin-top: 5px; margin-bottom: 5px; padding: 5px; border: 1px solid rgb(204, 204, 204); overflow: auto; color: rgb(0, 0, 0); font-family: "Courier New" !important; font-size: 12px !important; background-color: rgb(245, 245, 245);"><div class="cnblogs_code_toolbar" style="margin-top: 5px;"><span class="cnblogs_code_copy" style="padding-right: 5px; line-height: 1.8;"><a title="复制代码" style="color: rgb(0, 0, 0); border: none !important;"><img src="http://common.cnblogs.com/images/copycode.gif" alt="复制代码" style="max-width: 900px;"></a></span></div><pre style="white-space: pre-wrap; font-family: "Courier New" !important;"><span style="line-height: 1.8;">{"weatherinfo":{<br><span style="line-height: 1.8;">//基本信息;</span>
"city":"苏州","city_en":"suzhou",
"date_y":"2013年7月9日","date":"","week":"星期二","fchh":"18","cityid":"101190401",<br><span style="line-height: 1.8;">//摄氏温度</span>
"temp1":"30℃~37℃",
"temp2":"30℃~37℃",
"temp3":"29℃~35℃",
"temp4":"27℃~33℃",
"temp5":"27℃~31℃",
"temp6":"27℃~35℃",<br><span style="line-height: 1.8;">//华氏温度;</span>
"tempF1":"86℉~98.6℉",
"tempF2":"86℉~98.6℉",
"tempF3":"84.2℉~95℉",
"tempF4":"80.6℉~91.4℉",
"tempF5":"80.6℉~87.8℉",
"tempF6":"80.6℉~95℉",<br><span style="line-height: 1.8;">//天气描述;</span>
"weather1":"晴转多云",
"weather2":"晴转多云",
"weather3":"晴转多云",
"weather4":"多云",
"weather5":"雷阵雨转中雨",
"weather6":"雷阵雨转多云",<br><span style="line-height: 1.8;">//天气描述图片序号</span>
"img1":"0",
"img2":"1",
"img3":"0",
"img4":"1",
"img5":"0",
"img6":"1",
"img7":"1",
"img8":"99",
"img9":"4",
"img10":"8",
"img11":"4",
"img12":"1",<br><span style="line-height: 1.8;">//图片名称;</span>
"img_single":"1",
"img_title1":"晴",
"img_title2":"多云",
"img_title3":"晴",
"img_title4":"多云",
"img_title5":"晴",
"img_title6":"多云",
"img_title7":"多云",
"img_title8":"多云",
"img_title9":"雷阵雨",
"img_title10":"中雨",
"img_title11":"雷阵雨",
"img_title12":"多云",
"img_title_single":"多云",<br><span style="line-height: 1.8;">//风速描述</span>
"wind1":"西南风3-4级",
"wind2":"西南风3-4级",
"wind3":"东南风3-4级",
"wind4":"东南风3-4级转4-5级",
"wind5":"东南风4-5级转西南风3-4级",
"wind6":"西南风3-4级转4-5级",<br><span style="line-height: 1.8;">//风速级别描述</span>
"fx1":"西南风",
"fx2":"西南风",
"fl1":"3-4级",
"fl2":"3-4级",
"fl3":"3-4级",
"fl4":"3-4级转4-5级",
"fl5":"4-5级转3-4级",
"fl6":"3-4级转4-5级",<br><span style="line-height: 1.8;">//今日穿衣指数;</span>
"index":"炎热",
"index_d":"天气炎热,建议着短衫、短裙、短裤、薄型T恤衫等清凉夏季服装。",<br><span style="line-height: 1.8;">//48小时穿衣指数</span>
"index48":"炎热",
"index48_d":"天气炎热,建议着短衫、短裙、短裤、薄型T恤衫等清凉夏季服装。",<br><span style="line-height: 1.8;">//紫外线及48小时紫外线</span>
"index_uv":"中等",
"index48_uv":"中等",<br><span style="line-height: 1.8;">//洗车指数</span>
"index_xc":"适宜",<br><span style="line-height: 1.8;">//旅游指数</span>
"index_tr":"较不宜",<br><span style="line-height: 1.8;">//舒适指数</span>
"index_co":"很不舒适",
"st1":"36",
"st2":"28",
"st3":"36",
"st4":"28",
"st5":"34",
"st6":"27",<br><span style="line-height: 1.8;">//晨练指数</span>
"index_cl":"较适宜",<br><span style="line-height: 1.8;">//晾晒指数</span>
"index_ls":"适宜",<br><span style="line-height: 1.8;">//过敏指数</span>
"index_ag":"不易发"}}</span></pre><div class="cnblogs_code_toolbar" style="margin-top: 5px;"><span class="cnblogs_code_copy" style="padding-right: 5px; line-height: 1.8;"><a title="复制代码" style="color: rgb(0, 0, 0); border: none !important;"><img src="http://common.cnblogs.com/images/copycode.gif" alt="复制代码" style="max-width: 900px;"></a></span></div></div><p style="margin: 10px auto; color: rgb(51, 51, 51); font-family: verdana, Arial, Helvetica, sans-serif; line-height: 25.2px;"><span style="line-height: 1.5;">我们可以通过</span><span style="line-height: 1.5;">解析JSON,获取相应城市的天气数据。</span></p><p style="margin: 10px auto; color: rgb(51, 51, 51); font-family: verdana, Arial, Helvetica, sans-serif; line-height: 25.2px;">weather() 函数如下:</p><div class="cnblogs_code" style="margin-top: 5px; margin-bottom: 5px; padding: 5px; border: 1px solid rgb(204, 204, 204); overflow: auto; color: rgb(0, 0, 0); font-family: "Courier New" !important; font-size: 12px !important; background-color: rgb(245, 245, 245);"><div class="cnblogs_code_toolbar" style="margin-top: 5px;"><span class="cnblogs_code_copy" style="padding-right: 5px; line-height: 1.8;"><a title="复制代码" style="color: rgb(0, 0, 0); border: none !important;"><img src="http://common.cnblogs.com/images/copycode.gif" alt="复制代码" style="max-width: 900px;"></a></span></div><pre style="white-space: pre-wrap; font-family: "Courier New" !important;"><span style="line-height: 1.8; color: rgb(0, 0, 255);">private</span> <span style="line-height: 1.8; color: rgb(0, 0, 255);">function</span> weather(<span style="line-height: 1.8; color: rgb(128, 0, 128);">$n</span><span style="line-height: 1.8;">){
</span><span style="line-height: 1.8; color: rgb(0, 0, 255);">include</span>("weather_cityId.php"<span style="line-height: 1.8;">);
</span><span style="line-height: 1.8; color: rgb(128, 0, 128);">$c_name</span>=<span style="line-height: 1.8; color: rgb(128, 0, 128);">$weather_cityId</span>[<span style="line-height: 1.8; color: rgb(128, 0, 128);">$n</span><span style="line-height: 1.8;">];
</span><span style="line-height: 1.8; color: rgb(0, 0, 255);">if</span>(!<span style="line-height: 1.8; color: rgb(0, 0, 255);">empty</span>(<span style="line-height: 1.8; color: rgb(128, 0, 128);">$c_name</span><span style="line-height: 1.8;">)){
</span><span style="line-height: 1.8; color: rgb(128, 0, 128);">$json</span>=<span style="line-height: 1.8; color: rgb(0, 128, 128);">file_get_contents</span>("http://m.weather.com.cn/data/".<span style="line-height: 1.8; color: rgb(128, 0, 128);">$c_name</span>.".html"<span style="line-height: 1.8;">);
</span><span style="line-height: 1.8; color: rgb(0, 0, 255);">return</span> json_decode(<span style="line-height: 1.8; color: rgb(128, 0, 128);">$json</span><span style="line-height: 1.8;">);
} </span><span style="line-height: 1.8; color: rgb(0, 0, 255);">else</span><span style="line-height: 1.8;"> {
</span><span style="line-height: 1.8; color: rgb(0, 0, 255);">return</span> <span style="line-height: 1.8; color: rgb(0, 0, 255);">null</span><span style="line-height: 1.8;">;
}
}</span></pre><div class="cnblogs_code_toolbar" style="margin-top: 5px;"><span class="cnblogs_code_copy" style="padding-right: 5px; line-height: 1.8;"><a title="复制代码" style="color: rgb(0, 0, 0); border: none !important;"><img src="http://common.cnblogs.com/images/copycode.gif" alt="复制代码" style="max-width: 900px;"></a></span></div></div><p style="margin: 10px auto; color: rgb(51, 51, 51); font-family: verdana, Arial, Helvetica, sans-serif; line-height: 25.2px;">这里include 了一个城市对应关系文件 weather_cityId.php,格式如下:</p><div class="cnblogs_code" style="margin-top: 5px; margin-bottom: 5px; padding: 5px; border: 1px solid rgb(204, 204, 204); overflow: auto; color: rgb(0, 0, 0); font-family: "Courier New" !important; font-size: 12px !important; background-color: rgb(245, 245, 245);"><pre style="white-space: pre-wrap; font-family: "Courier New" !important;"><?<span style="line-height: 1.8;">php
</span><span style="line-height: 1.8; color: rgb(128, 0, 128);">$weather_cityId</span> = <span style="line-height: 1.8; color: rgb(0, 0, 255);">array</span>("北京"=>"101010100","上海"=>"101020100","苏州"=>"101190401"<span style="line-height: 1.8;">);
</span>?></pre></div><p style="margin: 10px auto; color: rgb(51, 51, 51); font-family: verdana, Arial, Helvetica, sans-serif; line-height: 25.2px;">根据传入的城市名,得到城市代码,如果不为空,则调用中国天气网的API进行查询,返回json格式的数据,然后进行解析并返回数据,如果为空,则返回null值。</p><p style="margin: 10px auto; color: rgb(51, 51, 51); font-family: verdana, Arial, Helvetica, sans-serif; line-height: 25.2px;"><span style="line-height: 1.8; font-size: 16px;"><strong><span style="line-height: 1.8; color: rgb(128, 0, 0);">五、组织回复消息形式</span></strong></span></p><p style="margin: 10px auto; color: rgb(51, 51, 51); font-family: verdana, Arial, Helvetica, sans-serif; line-height: 25.2px;">判断返回数据是否为空,若为空,则 $contentStr = "抱歉,没有查到\"".$str_key."\"的天气信息!";</p><p style="margin: 10px auto; color: rgb(51, 51, 51); font-family: verdana, Arial, Helvetica, sans-serif; line-height: 25.2px;">若返回数据不为空,则:</p><div class="cnblogs_code" style="margin-top: 5px; margin-bottom: 5px; padding: 5px; border: 1px solid rgb(204, 204, 204); overflow: auto; color: rgb(0, 0, 0); font-family: "Courier New" !important; font-size: 12px !important; background-color: rgb(245, 245, 245);"><pre style="white-space: pre-wrap; font-family: "Courier New" !important;">$contentStr = "【".$data->weatherinfo->city."天气预报】\n".$data->weatherinfo->date_y." ".$data->weatherinfo->fchh."时发布"."\n\n实时天气\n".$data->weatherinfo->weather1." ".$data->weatherinfo->temp1." ".$data->weatherinfo->wind1."\n\n温馨提示:".$data->weatherinfo->index_d."\n\n明天\n".$data->weatherinfo->weather2." ".$data->weatherinfo->temp2." ".$data->weatherinfo->wind2."\n\n后天\n".$data->weatherinfo->weather3." ".$data->weatherinfo->temp3." ".$data->weatherinfo->wind3;</pre></div><p style="margin: 10px auto; color: rgb(51, 51, 51); font-family: verdana, Arial, Helvetica, sans-serif; line-height: 25.2px;"><strong>说明:</strong></p><p style="margin: 10px auto 10px 30px; color: rgb(51, 51, 51); font-family: verdana, Arial, Helvetica, sans-serif; line-height: 25.2px;">$data->weatherinfo->city //获取城市名,这里为苏州</p><p style="margin: 10px auto 10px 30px; color: rgb(51, 51, 51); font-family: verdana, Arial, Helvetica, sans-serif; line-height: 25.2px;">$data->weatherinfo->date_y //获取日期,这里为2013年7月9日</p><p style="margin: 10px auto 10px 30px; color: rgb(51, 51, 51); font-family: verdana, Arial, Helvetica, sans-serif; line-height: 25.2px;">$data->weatherinfo->fchh //数据发布时间</p><p style="margin: 10px auto 10px 30px; color: rgb(51, 51, 51); font-family: verdana, Arial, Helvetica, sans-serif; line-height: 25.2px;">$data->weatherinfo->weather1 //实时天气</p><p style="margin: 10px auto 10px 30px; color: rgb(51, 51, 51); font-family: verdana, Arial, Helvetica, sans-serif; line-height: 25.2px;">$data->weatherinfo->temp1 //实时温度</p><p style="margin: 10px auto 10px 30px; color: rgb(51, 51, 51); font-family: verdana, Arial, Helvetica, sans-serif; line-height: 25.2px;">$data->weatherinfo->wind1 //实时风向和风速</p><p style="margin: 10px auto 10px 30px; color: rgb(51, 51, 51); font-family: verdana, Arial, Helvetica, sans-serif; line-height: 25.2px;">$data->weatherinfo->index_d //穿衣指数</p><p style="margin: 10px auto 10px 30px; color: rgb(51, 51, 51); font-family: verdana, Arial, Helvetica, sans-serif; line-height: 25.2px;">weather2, temp2, wind2 分别代表了明天的天气,温度和风向风速,其他的以此类推。</p><p style="margin: 10px auto 10px 30px; color: rgb(51, 51, 51); font-family: verdana, Arial, Helvetica, sans-serif; line-height: 25.2px;">\n //表示换行</p><p style="margin: 10px auto; color: rgb(51, 51, 51); font-family: verdana, Arial, Helvetica, sans-serif; line-height: 25.2px;"><span style="line-height: 1.8; font-size: 16px;"><strong><span style="line-height: 1.8; color: rgb(128, 0, 0);">六、测试</span></strong></span></p><p style="margin: 10px auto; color: rgb(51, 51, 51); font-family: verdana, Arial, Helvetica, sans-serif; line-height: 25.2px;"><img src="http://images.cnitblog.com/blog/370046/201307/10213749-55617ea54df84499b21f89a81bed1212.png" alt="" style="border: 0px; max-width: 900px;"></p><p style="margin: 10px auto; color: rgb(51, 51, 51); font-family: verdana, Arial, Helvetica, sans-serif; line-height: 25.2px;"><span style="line-height: 1.8; font-size: 16px;"><strong><span style="line-height: 1.8; color: rgb(128, 0, 0);">七、完整代码</span></strong></span></p><div class="cnblogs_code" style="margin-top: 5px; margin-bottom: 5px; padding: 5px; border: 1px solid rgb(204, 204, 204); overflow: auto; color: rgb(0, 0, 0); font-family: "Courier New" !important; font-size: 12px !important; background-color: rgb(245, 245, 245);"><div class="cnblogs_code_toolbar" style="margin-top: 5px;"><span class="cnblogs_code_copy" style="padding-right: 5px; line-height: 1.8;"><a title="复制代码" style="color: rgb(0, 0, 0); border: none !important;"><img src="http://common.cnblogs.com/images/copycode.gif" alt="复制代码" style="max-width: 900px;"></a></span></div><pre style="white-space: pre-wrap; font-family: "Courier New" !important;"><?<span style="line-height: 1.8;">php
</span><span style="line-height: 1.8; color: rgb(0, 128, 0);">/*</span><span style="line-height: 1.8; color: rgb(0, 128, 0);">*
* wechat php test
</span><span style="line-height: 1.8; color: rgb(0, 128, 0);">*/</span>
<span style="line-height: 1.8; color: rgb(0, 128, 0);">//</span><span style="line-height: 1.8; color: rgb(0, 128, 0);">define your token</span>
<span style="line-height: 1.8; color: rgb(0, 128, 128);">define</span>("TOKEN", "zhuojin"<span style="line-height: 1.8;">);
</span><span style="line-height: 1.8; color: rgb(128, 0, 128);">$wechatObj</span> = <span style="line-height: 1.8; color: rgb(0, 0, 255);">new</span><span style="line-height: 1.8;"> wechatCallbackapiTest();
</span><span style="line-height: 1.8; color: rgb(128, 0, 128);">$wechatObj</span>-><span style="line-height: 1.8;">responseMsg();
</span><span style="line-height: 1.8; color: rgb(0, 128, 0);">//</span><span style="line-height: 1.8; color: rgb(0, 128, 0);">$wechatObj->valid();</span>
<span style="line-height: 1.8; color: rgb(0, 0, 255);">class</span><span style="line-height: 1.8;"> wechatCallbackapiTest
{
</span><span style="line-height: 1.8; color: rgb(0, 128, 0);">/*</span><span style="line-height: 1.8; color: rgb(0, 128, 0);">public function valid()
{
$echoStr = $_GET["echostr"];
//valid signature , option
if($this->checkSignature()){
echo $echoStr;
exit;
}
}</span><span style="line-height: 1.8; color: rgb(0, 128, 0);">*/</span>
<span style="line-height: 1.8; color: rgb(0, 0, 255);">public</span> <span style="line-height: 1.8; color: rgb(0, 0, 255);">function</span><span style="line-height: 1.8;"> responseMsg()
{
</span><span style="line-height: 1.8; color: rgb(0, 128, 0);">//</span><span style="line-height: 1.8; color: rgb(0, 128, 0);">get post data, May be due to the different environments</span>
<span style="line-height: 1.8; color: rgb(128, 0, 128);">$postStr</span> = <span style="line-height: 1.8; color: rgb(128, 0, 128);">$GLOBALS</span>["HTTP_RAW_POST_DATA"<span style="line-height: 1.8;">];
</span><span style="line-height: 1.8; color: rgb(0, 128, 0);">//</span><span style="line-height: 1.8; color: rgb(0, 128, 0);">extract post data</span>
<span style="line-height: 1.8; color: rgb(0, 0, 255);">if</span> (!<span style="line-height: 1.8; color: rgb(0, 0, 255);">empty</span>(<span style="line-height: 1.8; color: rgb(128, 0, 128);">$postStr</span><span style="line-height: 1.8;">)){
</span><span style="line-height: 1.8; color: rgb(128, 0, 128);">$postObj</span> = <span style="line-height: 1.8; color: rgb(0, 128, 128);">simplexml_load_string</span>(<span style="line-height: 1.8; color: rgb(128, 0, 128);">$postStr</span>, 'SimpleXMLElement',<span style="line-height: 1.8;"> LIBXML_NOCDATA);
</span><span style="line-height: 1.8; color: rgb(128, 0, 128);">$RX_TYPE</span> = <span style="line-height: 1.8; color: rgb(0, 128, 128);">trim</span>(<span style="line-height: 1.8; color: rgb(128, 0, 128);">$postObj</span>-><span style="line-height: 1.8;">MsgType);
</span><span style="line-height: 1.8; color: rgb(0, 0, 255);">switch</span>(<span style="line-height: 1.8; color: rgb(128, 0, 128);">$RX_TYPE</span><span style="line-height: 1.8;">)
{
</span><span style="line-height: 1.8; color: rgb(0, 0, 255);">case</span> "text":
<span style="line-height: 1.8; color: rgb(128, 0, 128);">$resultStr</span> = <span style="line-height: 1.8; color: rgb(128, 0, 128);">$this</span>->handleText(<span style="line-height: 1.8; color: rgb(128, 0, 128);">$postObj</span><span style="line-height: 1.8;">);
</span><span style="line-height: 1.8; color: rgb(0, 0, 255);">break</span><span style="line-height: 1.8;">;
</span><span style="line-height: 1.8; color: rgb(0, 0, 255);">case</span> "event":
<span style="line-height: 1.8; color: rgb(128, 0, 128);">$resultStr</span> = <span style="line-height: 1.8; color: rgb(128, 0, 128);">$this</span>->handleEvent(<span style="line-height: 1.8; color: rgb(128, 0, 128);">$postObj</span><span style="line-height: 1.8;">);
</span><span style="line-height: 1.8; color: rgb(0, 0, 255);">break</span><span style="line-height: 1.8;">;
</span><span style="line-height: 1.8; color: rgb(0, 0, 255);">default</span>:
<span style="line-height: 1.8; color: rgb(128, 0, 128);">$resultStr</span> = "Unknow msg type: ".<span style="line-height: 1.8; color: rgb(128, 0, 128);">$RX_TYPE</span><span style="line-height: 1.8;">;
</span><span style="line-height: 1.8; color: rgb(0, 0, 255);">break</span><span style="line-height: 1.8;">;
}
</span><span style="line-height: 1.8; color: rgb(0, 0, 255);">echo</span> <span style="line-height: 1.8; color: rgb(128, 0, 128);">$resultStr</span><span style="line-height: 1.8;">;
}</span><span style="line-height: 1.8; color: rgb(0, 0, 255);">else</span><span style="line-height: 1.8;"> {
</span><span style="line-height: 1.8; color: rgb(0, 0, 255);">echo</span> ""<span style="line-height: 1.8;">;
</span><span style="line-height: 1.8; color: rgb(0, 0, 255);">exit</span><span style="line-height: 1.8;">;
}
}
</span><span style="line-height: 1.8; color: rgb(0, 0, 255);">public</span> <span style="line-height: 1.8; color: rgb(0, 0, 255);">function</span> handleText(<span style="line-height: 1.8; color: rgb(128, 0, 128);">$postObj</span><span style="line-height: 1.8;">)
{
</span><span style="line-height: 1.8; color: rgb(128, 0, 128);">$fromUsername</span> = <span style="line-height: 1.8; color: rgb(128, 0, 128);">$postObj</span>-><span style="line-height: 1.8;">FromUserName;
</span><span style="line-height: 1.8; color: rgb(128, 0, 128);">$toUsername</span> = <span style="line-height: 1.8; color: rgb(128, 0, 128);">$postObj</span>-><span style="line-height: 1.8;">ToUserName;
</span><span style="line-height: 1.8; color: rgb(128, 0, 128);">$keyword</span> = <span style="line-height: 1.8; color: rgb(0, 128, 128);">trim</span>(<span style="line-height: 1.8; color: rgb(128, 0, 128);">$postObj</span>-><span style="line-height: 1.8;">Content);
</span><span style="line-height: 1.8; color: rgb(128, 0, 128);">$time</span> = <span style="line-height: 1.8; color: rgb(0, 128, 128);">time</span><span style="line-height: 1.8;">();
</span><span style="line-height: 1.8; color: rgb(128, 0, 128);">$textTpl</span> = "<span style="line-height: 1.8;"><xml>
<ToUserName><!]></ToUserName>
<FromUserName><!]></FromUserName>
<CreateTime>%s</CreateTime>
<MsgType><!]></MsgType>
<Content><!]></Content>
<FuncFlag>0</FuncFlag>
</xml></span>"<span style="line-height: 1.8;">;
</span><span style="line-height: 1.8; color: rgb(0, 0, 255);">if</span>(!<span style="line-height: 1.8; color: rgb(0, 0, 255);">empty</span>( <span style="line-height: 1.8; color: rgb(128, 0, 128);">$keyword</span><span style="line-height: 1.8;"> ))
{
</span><span style="line-height: 1.8; color: rgb(128, 0, 128);">$msgType</span> = "text"<span style="line-height: 1.8;">;
</span><span style="line-height: 1.8; color: rgb(0, 128, 0);">//</span><span style="line-height: 1.8; color: rgb(0, 128, 0);">天气</span>
<span style="line-height: 1.8; color: rgb(128, 0, 128);">$str</span> = mb_substr(<span style="line-height: 1.8; color: rgb(128, 0, 128);">$keyword</span>,-2,2,"UTF-8"<span style="line-height: 1.8;">);
</span><span style="line-height: 1.8; color: rgb(128, 0, 128);">$str_key</span> = mb_substr(<span style="line-height: 1.8; color: rgb(128, 0, 128);">$keyword</span>,0,-2,"UTF-8"<span style="line-height: 1.8;">);
</span><span style="line-height: 1.8; color: rgb(0, 0, 255);">if</span>(<span style="line-height: 1.8; color: rgb(128, 0, 128);">$str</span> == '天气' && !<span style="line-height: 1.8; color: rgb(0, 0, 255);">empty</span>(<span style="line-height: 1.8; color: rgb(128, 0, 128);">$str_key</span><span style="line-height: 1.8;">)){
</span><span style="line-height: 1.8; color: rgb(128, 0, 128);">$data</span> = <span style="line-height: 1.8; color: rgb(128, 0, 128);">$this</span>->weather(<span style="line-height: 1.8; color: rgb(128, 0, 128);">$str_key</span><span style="line-height: 1.8;">);
</span><span style="line-height: 1.8; color: rgb(0, 0, 255);">if</span>(<span style="line-height: 1.8; color: rgb(0, 0, 255);">empty</span>(<span style="line-height: 1.8; color: rgb(128, 0, 128);">$data</span>-><span style="line-height: 1.8;">weatherinfo)){
</span><span style="line-height: 1.8; color: rgb(128, 0, 128);">$contentStr</span> = "抱歉,没有查到\"".<span style="line-height: 1.8; color: rgb(128, 0, 128);">$str_key</span>."\"的天气信息!"<span style="line-height: 1.8;">;
} </span><span style="line-height: 1.8; color: rgb(0, 0, 255);">else</span><span style="line-height: 1.8;"> {
</span><span style="line-height: 1.8; color: rgb(128, 0, 128);">$contentStr</span> = "【".<span style="line-height: 1.8; color: rgb(128, 0, 128);">$data</span>->weatherinfo->city."天气预报】\n".<span style="line-height: 1.8; color: rgb(128, 0, 128);">$data</span>->weatherinfo->date_y." ".<span style="line-height: 1.8; color: rgb(128, 0, 128);">$data</span>->weatherinfo->fchh."时发布"."\n\n实时天气\n".<span style="line-height: 1.8; color: rgb(128, 0, 128);">$data</span>->weatherinfo->weather1." ".<span style="line-height: 1.8; color: rgb(128, 0, 128);">$data</span>->weatherinfo->temp1." ".<span style="line-height: 1.8; color: rgb(128, 0, 128);">$data</span>->weatherinfo->wind1."\n\n温馨提示:".<span style="line-height: 1.8; color: rgb(128, 0, 128);">$data</span>->weatherinfo->index_d."\n\n明天\n".<span style="line-height: 1.8; color: rgb(128, 0, 128);">$data</span>->weatherinfo->weather2." ".<span style="line-height: 1.8; color: rgb(128, 0, 128);">$data</span>->weatherinfo->temp2." ".<span style="line-height: 1.8; color: rgb(128, 0, 128);">$data</span>->weatherinfo->wind2."\n\n后天\n".<span style="line-height: 1.8; color: rgb(128, 0, 128);">$data</span>->weatherinfo->weather3." ".<span style="line-height: 1.8; color: rgb(128, 0, 128);">$data</span>->weatherinfo->temp3." ".<span style="line-height: 1.8; color: rgb(128, 0, 128);">$data</span>->weatherinfo-><span style="line-height: 1.8;">wind3;
}
} </span><span style="line-height: 1.8; color: rgb(0, 0, 255);">else</span><span style="line-height: 1.8;"> {
</span><span style="line-height: 1.8; color: rgb(128, 0, 128);">$contentStr</span> = "感谢您关注【卓锦苏州】"."\n"."微信号:zhuojinsz"."\n"."卓越锦绣,名城苏州,我们为您提供苏州本地生活指南,苏州相关信息查询,做最好的苏州微信平台。"."\n"."目前平台功能如下:"."\n"."【1】 查天气,如输入:苏州天气"."\n"."【2】 查公交,如输入:苏州公交178"."\n"."【3】 翻译,如输入:翻译I love you"."\n"."【4】 苏州信息查询,如输入:苏州观前街"."\n"."更多内容,敬请期待..."<span style="line-height: 1.8;">;
}
</span><span style="line-height: 1.8; color: rgb(128, 0, 128);">$resultStr</span> = <span style="line-height: 1.8; color: rgb(0, 128, 128);">sprintf</span>(<span style="line-height: 1.8; color: rgb(128, 0, 128);">$textTpl</span>, <span style="line-height: 1.8; color: rgb(128, 0, 128);">$fromUsername</span>, <span style="line-height: 1.8; color: rgb(128, 0, 128);">$toUsername</span>, <span style="line-height: 1.8; color: rgb(128, 0, 128);">$time</span>, <span style="line-height: 1.8; color: rgb(128, 0, 128);">$msgType</span>, <span style="line-height: 1.8; color: rgb(128, 0, 128);">$contentStr</span><span style="line-height: 1.8;">);
</span><span style="line-height: 1.8; color: rgb(0, 0, 255);">echo</span> <span style="line-height: 1.8; color: rgb(128, 0, 128);">$resultStr</span><span style="line-height: 1.8;">;
}</span><span style="line-height: 1.8; color: rgb(0, 0, 255);">else</span><span style="line-height: 1.8;">{
</span><span style="line-height: 1.8; color: rgb(0, 0, 255);">echo</span> "Input something..."<span style="line-height: 1.8;">;
}
}
</span><span style="line-height: 1.8; color: rgb(0, 0, 255);">public</span> <span style="line-height: 1.8; color: rgb(0, 0, 255);">function</span> handleEvent(<span style="line-height: 1.8; color: rgb(128, 0, 128);">$object</span><span style="line-height: 1.8;">)
{
</span><span style="line-height: 1.8; color: rgb(128, 0, 128);">$contentStr</span> = ""<span style="line-height: 1.8;">;
</span><span style="line-height: 1.8; color: rgb(0, 0, 255);">switch</span> (<span style="line-height: 1.8; color: rgb(128, 0, 128);">$object</span>-><span style="line-height: 1.8;">Event)
{
</span><span style="line-height: 1.8; color: rgb(0, 0, 255);">case</span> "subscribe":
<span style="line-height: 1.8; color: rgb(128, 0, 128);">$contentStr</span> = "感谢您关注【卓锦苏州】"."\n"."微信号:zhuojinsz"."\n"."卓越锦绣,名城苏州,我们为您提供苏州本地生活指南,苏州相关信息查询,做最好的苏州微信平台。"."\n"."目前平台功能如下:"."\n"."【1】 查天气,如输入:苏州天气"."\n"."【2】 查公交,如输入:苏州公交178"."\n"."【3】 翻译,如输入:翻译I love you"."\n"."【4】 苏州信息查询,如输入:苏州观前街"."\n"."更多内容,敬请期待..."<span style="line-height: 1.8;">;
</span><span style="line-height: 1.8; color: rgb(0, 0, 255);">break</span><span style="line-height: 1.8;">;
</span><span style="line-height: 1.8; color: rgb(0, 0, 255);">default</span> :
<span style="line-height: 1.8; color: rgb(128, 0, 128);">$contentStr</span> = "Unknow Event: ".<span style="line-height: 1.8; color: rgb(128, 0, 128);">$object</span>-><span style="line-height: 1.8;">Event;
</span><span style="line-height: 1.8; color: rgb(0, 0, 255);">break</span><span style="line-height: 1.8;">;
}
</span><span style="line-height: 1.8; color: rgb(128, 0, 128);">$resultStr</span> = <span style="line-height: 1.8; color: rgb(128, 0, 128);">$this</span>->responseText(<span style="line-height: 1.8; color: rgb(128, 0, 128);">$object</span>, <span style="line-height: 1.8; color: rgb(128, 0, 128);">$contentStr</span><span style="line-height: 1.8;">);
</span><span style="line-height: 1.8; color: rgb(0, 0, 255);">return</span> <span style="line-height: 1.8; color: rgb(128, 0, 128);">$resultStr</span><span style="line-height: 1.8;">;
}
</span><span style="line-height: 1.8; color: rgb(0, 0, 255);">public</span> <span style="line-height: 1.8; color: rgb(0, 0, 255);">function</span> responseText(<span style="line-height: 1.8; color: rgb(128, 0, 128);">$object</span>, <span style="line-height: 1.8; color: rgb(128, 0, 128);">$content</span>, <span style="line-height: 1.8; color: rgb(128, 0, 128);">$flag</span>=0<span style="line-height: 1.8;">)
{
</span><span style="line-height: 1.8; color: rgb(128, 0, 128);">$textTpl</span> = "<span style="line-height: 1.8;"><xml>
<ToUserName><!]></ToUserName>
<FromUserName><!]></FromUserName>
<CreateTime>%s</CreateTime>
<MsgType><!]></MsgType>
<Content><!]></Content>
<FuncFlag>%d</FuncFlag>
</xml></span>"<span style="line-height: 1.8;">;
</span><span style="line-height: 1.8; color: rgb(128, 0, 128);">$resultStr</span> = <span style="line-height: 1.8; color: rgb(0, 128, 128);">sprintf</span>(<span style="line-height: 1.8; color: rgb(128, 0, 128);">$textTpl</span>, <span style="line-height: 1.8; color: rgb(128, 0, 128);">$object</span>->FromUserName, <span style="line-height: 1.8; color: rgb(128, 0, 128);">$object</span>->ToUserName, <span style="line-height: 1.8; color: rgb(0, 128, 128);">time</span>(), <span style="line-height: 1.8; color: rgb(128, 0, 128);">$content</span>, <span style="line-height: 1.8; color: rgb(128, 0, 128);">$flag</span><span style="line-height: 1.8;">);
</span><span style="line-height: 1.8; color: rgb(0, 0, 255);">return</span> <span style="line-height: 1.8; color: rgb(128, 0, 128);">$resultStr</span><span style="line-height: 1.8;">;
}
</span><span style="line-height: 1.8; color: rgb(0, 0, 255);">private</span> <span style="line-height: 1.8; color: rgb(0, 0, 255);">function</span> weather(<span style="line-height: 1.8; color: rgb(128, 0, 128);">$n</span><span style="line-height: 1.8;">){
</span><span style="line-height: 1.8; color: rgb(0, 0, 255);">include</span>("weather_cityId.php"<span style="line-height: 1.8;">);
</span><span style="line-height: 1.8; color: rgb(128, 0, 128);">$c_name</span>=<span style="line-height: 1.8; color: rgb(128, 0, 128);">$weather_cityId</span>[<span style="line-height: 1.8; color: rgb(128, 0, 128);">$n</span><span style="line-height: 1.8;">];
</span><span style="line-height: 1.8; color: rgb(0, 0, 255);">if</span>(!<span style="line-height: 1.8; color: rgb(0, 0, 255);">empty</span>(<span style="line-height: 1.8; color: rgb(128, 0, 128);">$c_name</span><span style="line-height: 1.8;">)){
</span><span style="line-height: 1.8; color: rgb(128, 0, 128);">$json</span>=<span style="line-height: 1.8; color: rgb(0, 128, 128);">file_get_contents</span>("http://m.weather.com.cn/data/".<span style="line-height: 1.8; color: rgb(128, 0, 128);">$c_name</span>.".html"<span style="line-height: 1.8;">);
</span><span style="line-height: 1.8; color: rgb(0, 0, 255);">return</span> json_decode(<span style="line-height: 1.8; color: rgb(128, 0, 128);">$json</span><span style="line-height: 1.8;">);
} </span><span style="line-height: 1.8; color: rgb(0, 0, 255);">else</span><span style="line-height: 1.8;"> {
</span><span style="line-height: 1.8; color: rgb(0, 0, 255);">return</span> <span style="line-height: 1.8; color: rgb(0, 0, 255);">null</span><span style="line-height: 1.8;">;
}
}
</span><span style="line-height: 1.8; color: rgb(0, 0, 255);">private</span> <span style="line-height: 1.8; color: rgb(0, 0, 255);">function</span><span style="line-height: 1.8;"> checkSignature()
{
</span><span style="line-height: 1.8; color: rgb(128, 0, 128);">$signature</span> = <span style="line-height: 1.8; color: rgb(128, 0, 128);">$_GET</span>["signature"<span style="line-height: 1.8;">];
</span><span style="line-height: 1.8; color: rgb(128, 0, 128);">$timestamp</span> = <span style="line-height: 1.8; color: rgb(128, 0, 128);">$_GET</span>["timestamp"<span style="line-height: 1.8;">];
</span><span style="line-height: 1.8; color: rgb(128, 0, 128);">$nonce</span> = <span style="line-height: 1.8; color: rgb(128, 0, 128);">$_GET</span>["nonce"<span style="line-height: 1.8;">];
</span><span style="line-height: 1.8; color: rgb(128, 0, 128);">$token</span> =<span style="line-height: 1.8;"> TOKEN;
</span><span style="line-height: 1.8; color: rgb(128, 0, 128);">$tmpArr</span> = <span style="line-height: 1.8; color: rgb(0, 0, 255);">array</span>(<span style="line-height: 1.8; color: rgb(128, 0, 128);">$token</span>, <span style="line-height: 1.8; color: rgb(128, 0, 128);">$timestamp</span>, <span style="line-height: 1.8; color: rgb(128, 0, 128);">$nonce</span><span style="line-height: 1.8;">);
</span><span style="line-height: 1.8; color: rgb(0, 128, 128);">sort</span>(<span style="line-height: 1.8; color: rgb(128, 0, 128);">$tmpArr</span><span style="line-height: 1.8;">);
</span><span style="line-height: 1.8; color: rgb(128, 0, 128);">$tmpStr</span> = <span style="line-height: 1.8; color: rgb(0, 128, 128);">implode</span>( <span style="line-height: 1.8; color: rgb(128, 0, 128);">$tmpArr</span><span style="line-height: 1.8;"> );
</span><span style="line-height: 1.8; color: rgb(128, 0, 128);">$tmpStr</span> = <span style="line-height: 1.8; color: rgb(0, 128, 128);">sha1</span>( <span style="line-height: 1.8; color: rgb(128, 0, 128);">$tmpStr</span><span style="line-height: 1.8;"> );
</span><span style="line-height: 1.8; color: rgb(0, 0, 255);">if</span>( <span style="line-height: 1.8; color: rgb(128, 0, 128);">$tmpStr</span> == <span style="line-height: 1.8; color: rgb(128, 0, 128);">$signature</span><span style="line-height: 1.8;"> ){
</span><span style="line-height: 1.8; color: rgb(0, 0, 255);">return</span> <span style="line-height: 1.8; color: rgb(0, 0, 255);">true</span><span style="line-height: 1.8;">;
}</span><span style="line-height: 1.8; color: rgb(0, 0, 255);">else</span><span style="line-height: 1.8;">{
</span><span style="line-height: 1.8; color: rgb(0, 0, 255);">return</span> <span style="line-height: 1.8; color: rgb(0, 0, 255);">false</span><span style="line-height: 1.8;">;
}
}
}
</span>?></pre><div class="cnblogs_code_toolbar" style="margin-top: 5px;"><span class="cnblogs_code_copy" style="padding-right: 5px; line-height: 1.8;"><a title="复制代码" style="color: rgb(0, 0, 0); border: none !important;"><img src="http://common.cnblogs.com/images/copycode.gif" alt="复制代码" style="max-width: 900px;"></a></span></div></div><p style="margin: 10px auto; color: rgb(51, 51, 51); font-family: verdana, Arial, Helvetica, sans-serif; line-height: 25.2px;">关于城市对应关系文件 weather_cityId.php,目前更新到了2564个城市,以后还会继续增加,请到 <a href="http://pan.baidu.com/s/1c0s3Jby" target="_blank" style="text-decoration: none; color: rgb(0, 0, 0); border-bottom-width: 1px; border-bottom-style: dotted; border-bottom-color: rgb(51, 51, 51);"><span style="line-height: 1.8;"><strong>乐思乐享</strong></span></a><span style="line-height: 1.8;"> 官方网盘(URL:<a href="http://pan.baidu.com/s/1c0s3Jby" target="_blank" style="text-decoration: none; color: rgb(0, 0, 0); border-bottom-width: 1px; border-bottom-style: dotted; border-bottom-color: rgb(51, 51, 51);">http://pan.baidu.com/s/1c0s3Jby</a>)</span>下载吧。</p><p style="margin: 10px auto; color: rgb(51, 51, 51); font-family: verdana, Arial, Helvetica, sans-serif; line-height: 25.2px;"><span style="line-height: 1.8; font-size: 16px;"><strong><span style="line-height: 1.8; color: rgb(128, 0, 0);">八、关注</span></strong></span></p><p style="margin: 10px auto; color: rgb(51, 51, 51); font-family: verdana, Arial, Helvetica, sans-serif; line-height: 25.2px;">请关注<span style="line-height: 1.8; color: rgb(128, 0, 0);"> </span><span style="line-height: 1.8;"><span style="line-height: 1.8; color: rgb(128, 0, 0);"><strong>卓锦苏州</strong></span> </span>微信公众帐号,<span style="line-height: 1.8; color: rgb(128, 0, 0);"><strong>卓锦苏州</strong></span> 基于BAE 平台开发,针对于主流的微信功能进行开发测试。</p><p style="margin: 10px auto; color: rgb(51, 51, 51); font-family: verdana, Arial, Helvetica, sans-serif; line-height: 25.2px;">您可以关注 <span style="line-height: 1.8; color: rgb(128, 0, 0);"><strong>卓锦苏州</strong></span> 公众帐号进行功能测试,以及获取新的应用开发。</p><p style="margin: 10px auto; color: rgb(51, 51, 51); font-family: verdana, Arial, Helvetica, sans-serif; line-height: 25.2px;"><span style="line-height: 1.8; color: rgb(0, 0, 0);">1. <span style="line-height: 25px; orphans: 2; widows: 2; font-stretch: normal;">登录微信客户端,通讯录 -> 添加朋友 -> 查找公众号 -></span><span style="line-height: 25px; orphans: 2; widows: 2; font-stretch: normal;"> <span style="line-height: 1.8; color: rgb(128, 0, 0);"><strong>zhuojinsz</strong></span></span><span style="line-height: 25px; orphans: 2; widows: 2; font-stretch: normal;">,查找并关注。</span></span></p><p style="margin: 10px auto; color: rgb(51, 51, 51); font-family: verdana, Arial, Helvetica, sans-serif; line-height: 25.2px;">2. 扫描二维码:</p><p style="margin: 10px auto; color: rgb(51, 51, 51); font-family: verdana, Arial, Helvetica, sans-serif; line-height: 25.2px;"><img src="http://images.cnitblog.com/blog/370046/201310/07160054-359dcfa75fd34464bc6d8d8224a700f5.jpg" alt="" style="border: 0px; max-width: 900px;"></p><p style="margin: 10px auto; color: rgb(51, 51, 51); font-family: verdana, Arial, Helvetica, sans-serif; line-height: 25.2px;"><span style="line-height: 1.8; color: rgb(128, 0, 0);"><strong>卓锦苏州</strong></span><span style="line-height: 1.8;"> 功能列表。</span></p><p style="margin: 10px auto; color: rgb(51, 51, 51); font-family: verdana, Arial, Helvetica, sans-serif; line-height: 25.2px;"><span style="line-height: 1.8;"><img src="http://images.cnitblog.com/blog/370046/201306/06160124-051d8d406e254a5a956947ade6977f21.png" alt="" style="border: 0px; max-width: 900px;"></span></p><p style="margin: 10px auto; color: rgb(51, 51, 51); font-family: verdana, Arial, Helvetica, sans-serif; line-height: 25.2px;"> </p><hr style="color: rgb(51, 51, 51); font-family: verdana, Arial, Helvetica, sans-serif; line-height: 25.2px;"><p style="margin: 10px auto; color: rgb(51, 51, 51); font-family: verdana, Arial, Helvetica, sans-serif; line-height: 25.2px;"><span style="line-height: 1.8; color: rgb(128, 0, 0);"><strong>David Camp</strong></span></p><p style="margin: 10px auto; color: rgb(51, 51, 51); font-family: verdana, Arial, Helvetica, sans-serif; line-height: 25.2px;"><span style="line-height: 1.8; color: rgb(128, 0, 0);"><strong><strong><strong>我们永远相信,分享是一种美德 | </strong></strong>We Believe, Great People Share Knowledge...</strong></span></p></div>
页:
[1]