Coder Social home page Coder Social logo

wechat-php-sdk's People

Contributors

allanpk716 avatar dodgepudding avatar easytzb avatar erasin avatar fanchou avatar foamzou avatar hackingangle avatar involvements avatar jackliyang avatar jifei avatar kmfish avatar l953422179 avatar lanrion avatar leeeboo avatar lewisay avatar liuwm91 avatar marskenneth avatar moodysky avatar mr-liusg avatar neway3000 avatar newdir avatar nfer avatar nigelvon avatar picasso250 avatar pkkgu avatar rming avatar sarices avatar see365 avatar woody-wang avatar ys21426 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

wechat-php-sdk's Issues

uid是如何获取的?

测试你的test.php时,出现如下的信息:
array(2) { ["ret"]=> string(6) "-20000" ["msg"]=> string(19) "Request is denied! " }

问一下,uid是如何获取的?

ERROR CODE -2

不明原因 出现了-2
public function login($log=false){
$snoopy = new Snoopy;
$send_snoopy->referer ="https://mp.weixin.qq.com/";
$submit = "https://mp.weixin.qq.com/cgi-bin/login?lang=zh_CN";
$post["username"] = $this->_account;
$post["pwd"] = md5($this->_password);
$post["imgcode"] = "";
echo json_encode($post);
$post["f"] = "json";
$snoopy->submit($submit,$post);
if($log){
echo "--".$snoopy->results."--";
}
$cookie = '';
$this->log($snoopy->headers);
foreach ($snoopy->headers as $key => $value) {
$value = trim($value);
if(preg_match('/^set-cookie:[\s]+([^=]+)=([^;]+)/i', $value,$match))
$cookie .=$match[1].'='.$match[2].'; ';
}
if ($cookie) {
$send_snoopy = new Snoopy;
$send_snoopy->rawheaders['Cookie']= $cookie;
$send_snoopy->maxredirs = 0;
$url = "https://mp.weixin.qq.com/cgi-bin/indexpage?t=wxm-index&lang=zh_CN";
$send_snoopy->fetch($url);
$header = implode(',',$send_snoopy->headers);
$this->log('header:'.print_r($send_snoopy->headers,true));
preg_match("/token=(\d+)/i",$header,$matches);
if($matches){
$this->_token = $matches[1];
$this->log('token:'.$this->_token);
}
}
//获取toUserId OpenID
$cookieArray = explode(";",$cookie);
for($i=0;$i<count($cookieArray);$i++){
$tmp=explode("=",$cookieArray[$i]);
if(trim($tmp[0])=="slave_user"){
$this->w_id=$tmp[1];
}
}
$this->saveCookie($this->_cookiename,$cookie);
return $cookie;
}

结果如下:

{
"Ret": 400,
"ErrMsg": "",
"ShowVerifyCode": 0,
"ErrCode": -2
}

有时候登陆失败,是不是官方设置了验证码?

Array
(
[0] => HTTP/1.1 200 OK
[1] => Server: nginx/0.7.64
[2] => Date: Sun, 23 Jun 2013 03:14:43 GMT
[3] => Content-Type: application/json; charset=UTF-8
[4] => Connection: keep-alive
[5] => Content-Length: 65
[6] => Cache-Control: no-cache, must-revalidate
)

{"ret":"-20000", "msg":"Request is denied! "}

上传图片失败

这几天使用uploadFile方法上传图片失败,之前一直都能用。下面是腾讯服务器返回的信息:

<script>
  document.domain = location.hostname.match(/[^\.]*?\.[^\.]*?$/);
  var 
    url = window.location.href,
    type = url.match(/[\?&]type=([^&]*)/),
    formId = url.match(/[\?&]formId=([^&]*)/);

  type = type[1] || 0;
  formId = formId[1];
  top.W.upload.err("上传文件失败", type, formId);  
</script>

为什么getRevFrom与getRevTo的判断条件与其他不同?

public function getRevFrom() {
if ($this->_receive)
return $this->_receive['FromUserName'];
...

public function getRevTo() {
    if ($this->_receive)
        return $this->_receive['ToUserName'];
....

public function getRevType() {
    if (isset($this->_receive['MsgType']))
        return $this->_receive['MsgType'];

这里判断条件不一样是有特别原因?如果没有,建议用$this->_receive[] 这样风格比较统一。

How to use?

Hello, I am new here. Can anyone please guide me how to use this API. I saw the comments but they are mostly written in Korean (or Japanese? or Chinese?) I don't speak or read any of them. Please give me an instruction. Also I saw some 'tokenaccesskey' is required. How to get that?
Thanks in advance

两个小毛病

都是很小的问题,但debug花了不少时间

你的README中test1.php的第一行include少了一个分号
另外wechat.class.php第317行应该是:xml =

为什么Wechatext中upload()方法不能上传语言/视频文件,但是能上传图片?

为什么Wechatext中upload()方法不能上传语言/视频文件,但是能上传图片?自己尝试过很多次,但是都是如此,检查过代码,看不出什么原因,但是上传mp3的时候,就会出现NetworkError: 500 Internal Server Error错误,这个错误应该是指代码错误,但是上传图片却可以,不明白啊不明白,能指教下吗?

使用fetch 获取 用户管理页面,返回的页面数据为什么只有一部分?

想获取用户管理页面的用户列表,使用Snoopy 中的fetch返回的页面数据为什么只有一部分?
$send_snoopy = new Snoopy;
$send_snoopy->rawheaders['Cookie']= $this->cookie;
$send_snoopy->referer = 'https://mp.weixin.qq.com/cgi-bin/getmessage?t=wxm-message&token='.$this->_token.'&lang=zh_CN&count=50';
$url = 'https://mp.weixin.qq.com/cgi-bin/contactmanagepage?t=wxm-friend&token='.$this->_token.'&lang=zh_CN&pagesize=10&pageidx=0&type=0&groupid=0';
$send_snoopy->fetch($url);
$result = $send_snoopy->results;
$this->log('getUsers:'.$result);
if(!$result){
return false;
}
return $result;

请问“自己建了个模拟访问分组页怎么获取不到内容”?内有代码,请大神指教!谢谢

 /**
 * 获取分组列表
 */
public function getfriendlist($groupid=0)
{
    $url = "https://mp.weixin.qq.com/cgi-bin/contactmanagepage?t=wxm-friend&lang=zh_CN&pagesize=10&pageidx=0&type=0&groupid=".$groupid."&token=".$this->_token;

    $send_snoopy = new Snoopy;
    $send_snoopy->rawheaders['Cookie']= $this->cookie;

    $send_snoopy->fetch($url);
    $response = $send_snoopy->results;
    $tmp = "";
    if(preg_match('%<script id="json-friendList" type="json/text">([\s\S]*?)</script>%', $response, $match)) {
        $tmp = json_decode($match[1], true);
    }
    return $tmp;
}

sendPreview中的account参数是什么意思

sendPreview这个函数很有意义,但是没有详细说明,有几个问题想请教:
1、不知道account是什么意思?
2、photoid如何使用现有的图片,哪里获取现有图片的id?
3、photoid如果写成0会怎么样?

传图片错误!求指点!~

$wechat->uploadFile('N:\worksite\zt\zt\zuituware\1.jpg');这样的调用!~
返回错误!~
upload:<script>
document.domain = location.hostname.match(/[^.]?.[^.]?$/);
var
url = window.location.href,
type = url.match(/[?&]type=([^&])/),
formId = url.match(/[?&]formId=([^&]
)/);

type = type[1] || 0;
formId = formId[1];
top.W.upload.err("上传文件失败", type, formId);
</script>

Request is denied!

{ ["ret"]=> string(6) "-20000" ["msg"]=> string(19) "Request is denied! " }

请问获取的音频数据如果保存为标准的音频文件

我需要保存为flac文件,才可以支持google voice的api,但是我不知道怎么正确对数据编码,无论是mp3格式还是flac格式,file_put_contents('xx.MP3',$result) 这样保存应该是不行,用格式工厂转换为flac,采样率也配置了,但是google不识别。直接保存为flac也是一样。等待指导。。。。。。。。。求解燃眉之急

getInfo 和 Send 问题!

getInfo 和 Send 这两个函数获取数据或者发送消息都非常不稳定, 有时候突然可以, 有时候都不行, 这是什么原因呢?是不是微信平台问题? 或者代码问题?

请帮忙

已经成功回复文本消息,没搞明白如何回复图文消息,麻烦看一下下面的程序有什么不对吗?

       $newsdata = array(
           [0]=>array(
              'Title'=>'my title',
              'Description'=>'summary text',
              'PicUrl'=>'http://www.xxxxx.com/xxx.png',
              'Url'=>'http://www.xxxxx.com/xxx'
           )
        );
        $weObj->news($newsdata)->reply();

我查看了返回的XML,里面ArticleCount为什么是0呀?

请问获取的音频数据如果保存为标准的音频文件

我需要保存为flac文件,才可以支持google voice的api,但是我不知道怎么正确对数据编码,无论是mp3格式还是flac格式,file_put_contents('xx.MP3',$result) 这样保存应该是不行,用格式工厂转换为flac,采样率也配置了,但是google不识别。直接保存为flac也是一样。等待指导。。。。。。。。。求解燃眉之急

你好,有关ajax请求最新一条信息的

wechatext.class.php中的getTopMsg函数,
$submit = "https://mp.weixin.qq.com/cgi-bin/getmessage?t=ajax-message&lang=zh_CN&count=1&timeline=0&day=0&star=0&cgi=getmessage&offset=0";

这个地址你是哪里抓到的啊,我charles抓半天都没有这个请求。或者有什么方法可以得到这个地址。
我想得到第一个用户怎么办?就是实现一个类似getTopUser这种的。

还有,有什么好办法把FakeId和FromUsrName对应的呢。

很喜欢你写的Lib,

若能回答,感激不尽!

拜lz

为了使用方便,希望能有个发送消息快速调用方法。

例如这样
/**
* 设置发送消息-总调用-发送完成后退出程序
* @param $msg 消息,可以是文本或图文数组或音乐数组
*/
public function send($msg) {
if (is_string($msg)) {
//文字消息
$this->text($msg)->reply();
exit;
} elseif (is_array($msg) && !empty($msg['musicurl'])) {
//音乐消息
$this->music($msg['title'], $msg['desc'], $msg['musicurl'], $msg['hgmusicurl'])->reply();
exit;
} elseif (is_array($msg) && !empty($msg[0]['PicUrl'])) {
//图文消息
$this->news($msg)->reply();
exit;
}
return false;
}

wechat.class类news()方法无效

thinkphp中的$options = array(
0 => array
(
'Title'=>$home['title'],
'Description'=>$home['info'],
'PicUrl'=>$home['picurl'],
'Url'=>$url
)
);
$weixin->news($options);

这里回复图文信息不成功,不知道为什么?求救

在BAE上无法使用么?

在本地xampp下可以正常使用,但放到BAE上以后,就没响应了,是不是某些函数被BAE给禁用导致?还是某些目录没有写权限?比如cookie文件的缓存目录?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.