Skip to content

Instantly share code, notes, and snippets.

@codeasashu
Forked from cosenary/index.php
Created July 16, 2014 02:33
Show Gist options
  • Save codeasashu/fffd4811bfdbed083f81 to your computer and use it in GitHub Desktop.
Save codeasashu/fffd4811bfdbed083f81 to your computer and use it in GitHub Desktop.
<?php
require 'instagram.class.php';
$instagram = new Instagram(array(
'apiKey' => 'YOUR_APP_KEY',
'apiSecret' => 'YOUR_APP_SECRET',
'apiCallback' => 'YOUR_APP_CALLBACK'
));
$token = 'USER_ACCESS_TOKEN';
$instagram->setAccessToken($token);
$id = 'MEDIA_ID';
$result = $instagram->likeMedia($id);
if ($result->meta->code === 200) {
echo 'Success! The image was added to your likes.';
} else {
echo 'Something went wrong :(';
}
@umutc
Copy link

umutc commented May 1, 2015

media id is "975518621767596266_1452188869" but already "Something went wrong :("

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment