欧美一区二区三区老妇人-欧美做爰猛烈大尺度电-99久久夜色精品国产亚洲a-亚洲福利视频一区二区

微官網(wǎng)怎么制作,微網(wǎng)站設(shè)計(jì)圖解,微站建設(shè)方法

2022-11-09    分類: 網(wǎng)站設(shè)計(jì)

網(wǎng)站建設(shè) - 建站教程 - 網(wǎng)頁(yè)設(shè)計(jì)- 微官網(wǎng)怎么制作,微網(wǎng)站設(shè)計(jì)圖解,微站建設(shè)方法

近發(fā)現(xiàn)特別多的人在問(wèn)微網(wǎng)站是什么,微網(wǎng)站有什么用,微網(wǎng)站怎么做,微網(wǎng)站建設(shè)流程等問(wèn)題,今天,在這里為大家統(tǒng)一解答,希望能對(duì)各位愛(ài)學(xué)習(xí)人士有所幫助。
第一步:需要在微信公眾平臺(tái)上注冊(cè)一個(gè)自己的服務(wù)號(hào)或者訂閱號(hào)。
第二步:申請(qǐng)公眾賬號(hào)成功后,便可以使用其基本功能了,當(dāng)然,要想做成自己的微信官網(wǎng),則需要進(jìn)入開發(fā)模式,接入第三方接口。
第三步:注冊(cè)成功并登陸第三方接口,將注冊(cè)好的微信公眾號(hào)添加到第三方接口上,所需信息在微信公眾號(hào)設(shè)置下的賬號(hào)信息里。
第四步:添加公眾賬號(hào)后,連接公眾平臺(tái)與第三方接口,如圖:登錄微信公眾平臺(tái),點(diǎn)擊左側(cè)下方的【開發(fā)者中心】,點(diǎn)擊開發(fā)模式。
第五步:后,設(shè)計(jì)自己的微信官網(wǎng)。并且可在線預(yù)覽。
完成以上步驟后,并且認(rèn)證訂閱號(hào)或服務(wù)號(hào)后就可以做微信的二次開發(fā)了,比如我要制作一個(gè)群發(fā)功能的接口,需要使用一下微信接口:
1、獲取access token
2、新增臨時(shí)素材接口
3、上傳圖文消息素材接口
4、調(diào)用群發(fā)接口
接口代碼示例:WeixinApi.class.php
class WeixinApi{
private $appid,$appsecret,$media_id;
public function __construct($appid="",$appsecret=""){
$this->appid=$appid;
$this->appsecret=$appsecret;
}
//獲取token
public function getToken(){
if($_COOKIE["exptime"]=="" || time()-$_COOKIE["create_time"]>=$_COOKIE["exptime"]){
$token=@file_get_contents("https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid={$this->appid}&secret={$this->appsecret}");
$tokenarr=json_decode($token,true);
setcookie("exptime",$tokenarr["expires_in"],0,'/');
setcookie("access_token",$tokenarr["access_token"],0,'/');
setcookie("create_time",time(),0,'/');
}else{
$tokenarr=array(
"access_token"=>$_COOKIE["access_token"],
"expires_in"=>$_COOKIE["exptime"],
"create_time"=>$_COOKIE["create_time"]
);
}
return $tokenarr;
}
private function sockupload($phost,$pport,$purl,$filename,$file_data=array()){
$host = $phost;
$port = $pport;
$errno = '';
$errstr = '';
$timeout = 30;
$url = $purl;
/*$form_data = array(
'name' => 'lijie',
'gender' => 'man',
);*/
$file_data = array(
array(
'name' => 'media',
'filename' => $filename,
//'path' =>'1.jpg'
)
);
// create connect
$fp = fsockopen($host, $port, $errno, $errstr, $timeout);
if(!$fp){
return false;
}
// send request
srand((double)microtime()*1000000);
$boundary = "---------------------------".substr(md5(rand(0,32000)),0,10);
$data = "--$boundaryrn";
// form data
if(count($form_data)>0){
foreach($form_data as $key=>$val){
$data .= "Content-Disposition: form-data; name="".$key.""rn";
$data .= "Content-type:text/plainrnrn";
$data .= rawurlencode($val)."rn";
$data .= "--$boundaryrn";
}
}
// file data
if($filename!=""){
foreach($file_data as $file){
$data .= "Content-Disposition: form-data; name="".$file['name'].""; filename="".$file['filename'].""rn";
$pinfo=pathinfo($file['filename']);
$data .= "Content-Type: ".$pinfo["extension"]."rnrn";
$data .= implode("",file($file['filename']))."rn";
$data .= "--$boundaryrn";
}
}
$data .="--rnrn";
$out = "POST ${url} HTTP/1.1rn";
$out .= "Host:${host}rn";
$out .= "Content-type:multipart/form-data; boundary=$boundaryrn"; // multipart/form-data
$out .= "Content-length:".strlen($data)."rn";
$out .= "Connection:closernrn";
$out .= "${data}";
fputs($fp, $out);
// get response
$response = '';
while($row=fread($fp, 4096)){
$response .= $row;
}
$pos = strpos($response, "rnrn");
$response = substr($response, $pos+4);
return $response;
}
//json數(shù)據(jù)提交
private function jsonUpload($url,$jsdata){
$data_string = $jsdata;
$ch = curl_init();
curl_setopt ( $ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS,$data_string);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json;charset=utf-8',
'Content-Length: ' . strlen($data_string))
);
$result = curl_exec($ch);
curl_close ( $ch );
return $result;
}
//上傳媒體接口
public function upload($type,$filename){
$tokens=$this->getToken();
$result=$this->sockupload("api.weixin.qq.com",80,"/cgi-bin/media/upload?access_token=".$tokens["access_token"]."&type={$type}",$filename);
$media=json_decode($result,true);
$this->media_id=$media['media_id'];
return $this;
}
//上傳素材
public function uploadnews($title,$content,$author="",$url="",$digest="",$show_cover_pic="1"){
$articles=array(
"articles"=>array(
array(
"thumb_media_id"=>$this->media_id,
"author"=>$author,
"title"=>urlencode($title),
"content_source_url"=>$url,
"content"=>urlencode($content),
"digest"=>$digest,
"show_cover_pic"=>"1"
)
)
);
$tokens=$this->getToken();
$news=urldecode(json_encode($articles));
$result=$this->jsonUpload("api.weixin.qq.com/cgi-bin/media/uploadnews?access_token=".$tokens["access_token"]."",$news);
$newsdata=json_decode($result,true);
$this->media_id=$newsdata["media_id"];
return $this;
}
//群發(fā)接口
public function sendall(){
$arr=array(
"filter"=>array("is_to_all"=>true,"group_id"=>""),
"mpnews"=>array("media_id"=>$this->media_id),
"msgtype"=>"mpnews"
);
$json=json_encode($arr);
$tokens=$this->getToken();
$result=$this->jsonUpload("api.weixin.qq.com/cgi-bin/message/mass/sendall?access_token=".$tokens["access_token"]."",$json);
return $result;
}
}
使用:
$weixin=new WeixinApi($appid,$appsecret);
$result=$weixin->upload("image","圖片路徑")->uploadnews("文章標(biāo)題","文章內(nèi)容")->sendall();

網(wǎng)站名稱:微官網(wǎng)怎么制作,微網(wǎng)站設(shè)計(jì)圖解,微站建設(shè)方法
轉(zhuǎn)載來(lái)源:http://chinadenli.net/news/211904.html

網(wǎng)站建設(shè)、網(wǎng)絡(luò)推廣公司-創(chuàng)新互聯(lián),是專注品牌與效果的網(wǎng)站制作,網(wǎng)絡(luò)營(yíng)銷seo公司;服務(wù)項(xiàng)目有網(wǎng)站設(shè)計(jì)

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)

小程序開發(fā)
精品欧美一区二区三久久| 搡老熟女老女人一区二区| 国产水滴盗摄一区二区| 久久机热频这里只精品| 国产欧美一区二区色综合| 亚洲国产精品久久网午夜| 日韩在线一区中文字幕| 日本本亚洲三级在线播放| 欧美人与动牲交a精品| 国产激情国产精品久久源| 一本色道久久综合狠狠躁| 国产免费观看一区二区| 亚洲伦理中文字幕在线观看| 亚洲中文字幕在线乱码av| 日本精品最新字幕视频播放| 91麻豆精品欧美视频| 中文字幕高清免费日韩视频| 成人精品一级特黄大片| 亚洲精品国产美女久久久99| 黄色国产一区二区三区| 亚洲精品伦理熟女国产一区二区 | 成人三级视频在线观看不卡| 欧美美女视频在线免费看| 国产亚洲不卡一区二区| 亚洲视频在线观看免费中文字幕| 日本精品中文字幕在线视频 | 欧洲日韩精品一区二区三区| 国内女人精品一区二区三区| 欧美成人国产精品高清| 91麻豆精品欧美视频| 午夜激情视频一区二区| 亚洲一区二区精品免费视频| 欧美精品专区一区二区| 噜噜中文字幕一区二区| 国产真人无遮挡免费视频一区| 东京干男人都知道的天堂| 日韩aa一区二区三区| 精品人妻一区二区三区免费看| 日本婷婷色大香蕉视频在线观看| 99久热只有精品视频最新| 成人免费在线视频大香蕉|