slava-basko / yandex-api-webmaster
yandex Webmaster 客户端
dev-master
2016-10-27 12:51 UTC
Requires
- php: >=5.5
This package is auto-updated.
Last update: 2024-09-27 01:41:10 UTC
README
凭证?
如何获取令牌?无关紧要。选择您的方式 https://tech.yandex.com/oauth/doc/dg/concepts/ya-oauth-intro-docpage/
如何使用?
use Yandex\Auth\Token; use YandexWebmaster\Auth\User; use YandexWebmaster\Http\Client; $client = Client::create('client_id', 'client_password'); $user = new User('user_id', new Token('token')); try { $action = new \YandexWebmaster\Action\AddSiteAction($user, 'example.com'); $client->call($action); } catch (\Yandex\Exception\YandexException $ex) { //TODO: maybe write to log... }