fonclub/vk-auth

使用有效的手机号码和密码获取vk auth cookie(remixsid)的微型库

dev-master 2018-06-30 11:44 UTC

This package is auto-updated.

Last update: 2024-09-23 03:19:58 UTC


README

使用有效的手机号码和密码获取vk auth cookie(remixsid)的微型库

使用composer安装

composer require fonclub/vk-auth

用法

$agent = new \VkAuth\VkAuthAgent($vkCell, $vkPassword);
$remixsid = $agent->getRemixsid(); // makes few http requests to vk.com and returns valid remixsid value

// CookieJar object for usage in Guzzle Client, see [guzzle docs](http://docs.guzzlephp.org/en/latest/quickstart.html#cookies)
$jar = $agent->getAuthorizedCookieJar();

示例

存在一个example.php命令行脚本。它将打印账户的好友列表。要运行它,你需要创建一个名为test_login_pass_constants.php的文件,该文件包含两个必需的常量(有效的vk手机号码和密码),例如。

<?php
const TEST_VK_LOGIN = '81234567890';
const TEST_VK_PATH = 'password';

运行它

php example.php