Advertisement
Guest User

Untitled

a guest
Jun 25th, 2019
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. <?php
  2.  
  3. // Need to have the vk.php in the same directory.
  4. include 'vk.php';
  5.  
  6. // Please complete the below with your details/credentials.
  7. $config['secret_key'] = '';
  8. $config['client_id'] = '';
  9. $config['user_id'] = '';
  10. $config['access_token'] = '';
  11. $config['scope'] = 'wall,photos,friends,groups';
  12.  
  13. // Get a new instance of VK.
  14. $v = new Vk($config);
  15.  
  16. // Define the attachment to insert, in this case an image.
  17. $attachments = $v->upload_photo(0, array('1737759.jpg'));
  18.  
  19. // Post the message and image to your wall.
  20. $response = $v->wall->post(array(
  21. 'message'=>'test 1737759.jpg',
  22. 'attachments' => implode(',', $attachments)
  23. ));
  24.  
  25. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement