<?php
|
/**
|
* Instagram Integration
|
* File: /inc/integrations/Instagram.php
|
*
|
* Limits:
|
* - 50 uploads (including carousels) per user per 24-hour period
|
*/
|
|
namespace JVBase\integrations\services;
|
use JVBase\integrations\Admin;
|
use JVBase\Instance;
|
use JVBase\integrations\Integrations;
|
use JVBase\integrations\OAuth;
|
use JVBase\integrations\OAuthCredentials;
|
use JVBase\integrations\OAuthURLs;
|
use JVBase\integrations\Requests;
|
|
if (!defined('ABSPATH')) {
|
exit;
|
}
|
|
class Instagram extends Integrations
|
{
|
use Admin, Instance, OAuth, Requests;
|
protected function __construct()
|
{
|
$this->service_name = 'instagram';
|
$this->title = 'Instagram';
|
$this->icon = 'instagram-logo';
|
|
$this->apiVersion = 'v25.0';
|
$this->supportsWebp = false;
|
|
// $this->defineFields();
|
$this->defineOAuth();
|
// $this->defineActions();
|
|
$this->baseUrl = 'https://graph.instagram.com/'.$this->apiVersion;
|
parent::__construct();
|
}
|
|
public function defineOAuth():void
|
{
|
$this->oauth = new OAuthURLs(
|
'https://www.facebook.com/'.$this->apiVersion.'/dialog/oauth',
|
'https://graph.facebook.com/'.$this->apiVersion.'/oauth/access_token',
|
'https://graph.facebook.com/'.$this->apiVersion.'/me/permissions'
|
);
|
$this->oathScopes = [
|
'instagram_basic',
|
'instagram_content_publish',
|
];
|
}
|
protected function initialize(): void
|
{
|
// TODO: Implement initialize() method.
|
}
|
|
protected function refreshAccessToken(OAuthCredentials $credentials): array
|
{
|
// TODO: Implement refreshAccessToken() method.
|
return [];
|
}
|
|
protected function getRequestHeaders(): array
|
{
|
// TODO: Implement getRequestHeaders() method.
|
return [];
|
}
|
|
protected function handleResponse(\WP_Error|array $response, string $method, string $endpoint): array
|
{
|
// TODO: Implement handleResponse() method.
|
return [];
|
}
|
}
|