Coder Social home page Coder Social logo

weixin-private-api's Introduction

WeiXin-Private-API

微信公众平台私有接口, 发送信息, 发送图片, 得到用户信息, 解析用户fakeId

本接口参考weChat, 在此基础上作了修改和完善.

另, 微信公众平台接口改变很频繁, 本程序的修改速度有一定的滞后性, 若有朋友得知接口已变, 烦请告知我, 若能一起维护更好, [email protected], 多谢!

使用:

  1. 先在conifg.php中配置公众账号信息:
	$G_CONFIG["weiXin"] = array(
		'account' => '公众平台账号',
		'password' => '密码',
		'cookiePath' => $G_ROOT. '/cache/cookie', // cookie缓存文件路径
		'webTokenPath' => $G_ROOT. '/cache/webToken', // webToken缓存文件路径
	);
  1. test.php:
	require "config.php";
	require "include/WeiXin.php";

	$weiXin = new WeiXin($G_CONFIG['weiXin']);
	
	$testFakeId = "1477341522";
	$testFakeId2 = "2158620204";
	
	// 发送消息
	print_r($weiXin->send($testFakeId, "test"));
	
	// 发送图片, 图片必须要先在公共平台中上传, 得到图片Id
	print_r($weiXin->sendImage($testFakeId, "10000001"));
	
	// 批量发送
	print_r($weiXin->batSend(array($testFakeId, $testFakeId2), "test batSend"));
	
	// 得到用户信息
	print_r($weiXin->getUserInfo($testFakeId));
	
	// 得到最新消息
	print_r($weiXin->getLatestMsgs());

weixin-private-api's People

Contributors

lealife avatar

Watchers

 avatar  avatar

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.