{"id":15017629,"url":"https://github.com/labi-le/vk-utils","last_synced_at":"2026-01-25T19:39:47.214Z","repository":{"id":57010501,"uuid":"408104879","full_name":"labi-le/vk-utils","owner":"labi-le","description":"A set of utilities for working with vk api!","archived":false,"fork":false,"pushed_at":"2024-05-06T19:27:17.000Z","size":51,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-28T09:27:03.278Z","etag":null,"topics":["php","vk","vkapi"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/labi-le.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-09-19T11:10:09.000Z","updated_at":"2024-05-06T19:27:21.000Z","dependencies_parsed_at":"2024-09-21T08:40:38.161Z","dependency_job_id":null,"html_url":"https://github.com/labi-le/vk-utils","commit_stats":{"total_commits":15,"total_committers":2,"mean_commits":7.5,"dds":0.1333333333333333,"last_synced_commit":"5ea164f11a331c9b19c91b3658456e4601b177d8"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/labi-le%2Fvk-utils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/labi-le%2Fvk-utils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/labi-le%2Fvk-utils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/labi-le%2Fvk-utils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/labi-le","download_url":"https://codeload.github.com/labi-le/vk-utils/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239576791,"owners_count":19662114,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["php","vk","vkapi"],"created_at":"2024-09-24T19:50:46.670Z","updated_at":"2025-11-10T02:30:18.106Z","avatar_url":"https://github.com/labi-le.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# vk-utils\n\n[![GitHub license](https://img.shields.io/badge/license-BSD-green.svg)](https://github.com/labi-le/vk-utils/blob/main/LICENSE)\n[![Packagist Stars](https://img.shields.io/packagist/stars/labile/vk-utils)](https://packagist.org/packages/labile/vk-utils/stats)\n[![Packagist Stats](https://img.shields.io/packagist/dt/labile/vk-utils)](https://packagist.org/packages/labile/vk-utils/stats)\n\n[Документация на русском языке](README_RU.md)\n\n## Installation\n\n`composer require labile/vk-utils`\n\n## How to use it?\n\n### Simple request\n\n```php\nuse Astaroth\\VkUtils\\Client;\n\n$api = new Client;\n\n$response = $api-\u003erequest('wall.get', ['owner_id' =\u003e 1]);\n```\n\n### Use Request class\n\n```php\nuse Astaroth\\VkUtils\\Client;\nuse Astaroth\\VkUtils\\Requests\\Request;\n\n$api = new Client;\n\n$request = new Request('wall.get', ['owner_id' =\u003e 1]);\n$response = $api-\u003esend($request);\n```\n\n### Use ExecuteRequest class\n\nSending multiple requests at the same time\n\n```php\nuse Astaroth\\VkUtils\\Execute;\nuse Astaroth\\VkUtils\\Requests\\Request;\n\n$api = new Execute;\n$api-\u003esetDefaultToken('PUT ACCESS TOKEN');\n$execute = [\n    new Request('wall.get', ['owner_id' =\u003e 1]),\n    new Request('wall.get', ['owner_id' =\u003e 2]),\n    // ...more request\n    new Request('wall.get', ['owner_id' =\u003e 25]),\n    ];\n\n$response = $api-\u003esend($execute);\n```\n\n### Using the required api version\n\n```php\nuse Astaroth\\VkUtils\\Client;\n\n$api = new Client('5.131');\n```\n\n### Using a token for requests\n\nSet default token in client\n\n```php\nuse Astaroth\\VkUtils\\Client;\n\n$api = new Client();\n\n$api-\u003esetDefaultToken(\"PUT TOKEN\");\n```\n\nor so\n\n```php\nuse Astaroth\\VkUtils\\Requests\\Request;\nuse Astaroth\\VkUtils\\Client;\n\n$api = new Client;\n\n// The token in the request takes precedence over setDefaultToken\n$request = new Request('wall.get', ['owner_id' =\u003e 1], \"some_token\");\n```\n\n### Constructors\n\n#### Attachment upload constructor\n\n```php\nuse Astaroth\\VkUtils\\Builders\\Attachments\\Message\\Graffiti;\nuse Astaroth\\VkUtils\\Builders\\Attachments\\Photo;\nuse Astaroth\\VkUtils\\Builders\\Attachments\\Video;\nuse Astaroth\\VkUtils\\Uploader;\nuse Astaroth\\VkUtils\\Builders\\Attachments\\Message\\AudioMessage;\n\n$uploader = new Uploader();\n$uploader-\u003esetDefaultToken('PUT TOKEN');\n\n$attachments = $uploader-\u003eupload\n(\n    new Photo(\"dog.jpg\"),\n\n    new AudioMessage('meow.mp3'),\n    \n    //downloading from the link temporarily does not work\n    (new Video('https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ForBiggerEscapes.mp4'))\n        -\u003esetName('4 Biggers Escapes')\n        -\u003esetDescription('The video has nothing interesting, just an example')\n        -\u003esetWallpost(true),\n\n    new Graffiti('cat.png')\n);\n```\n\n#### Builder\n\n```php\n\nuse Astaroth\\VkUtils\\Builders;\nuse Astaroth\\VkUtils\\Builders\\Message;\nuse Astaroth\\VkUtils\\Builders\\Post;\n\n$token = 'PUT TOKEN';\n\n$builder = new \\Astaroth\\VkUtils\\Builder();\n\n$builders[] = (new Message)\n    -\u003esetMessage(\"hi me name is lola! im lol\")\n    -\u003esetPeerId(418618);\n\n$builders[] = (new Post)\n    -\u003esetMessage(\"hello subscribers\")\n\n$response = $builder-\u003ecreate(...$builders)\n);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flabi-le%2Fvk-utils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flabi-le%2Fvk-utils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flabi-le%2Fvk-utils/lists"}