class ShareaholicContentManager in Share Buttons, Related Posts, Content Analytics - Shareaholic 7.3
Same name and namespace in other branches
- 8 content_manager.php \ShareaholicContentManager
An interface to the Shareaholic Content Manager API's
@package shareaholic
Hierarchy
- class \ShareaholicContentManager
Expanded class hierarchy of ShareaholicContentManager
File
- ./
content_manager.php, line 13
View source
class ShareaholicContentManager {
/**
* Wrapper for the Shareaholic Content Manager Single Domain worker API
*
* @param string $domain
*/
public static function single_domain_worker($domain = NULL) {
if ($domain == NULL) {
$domain = $GLOBALS['base_url'];
}
if ($domain != NULL) {
$single_domain_job_url = ShareaholicUtilities::CM_API_URL . '/jobs/single_domain';
$data = '{"args":["' . $domain . '", {"force": true}]}';
$options = array(
'method' => 'POST',
'data' => $data,
'headers' => array(
'Content-Type' => 'application/json',
),
);
$response = drupal_http_request($single_domain_job_url, $options);
}
}
/**
* Wrapper for the Shareaholic Content Manager Single Page worker API
*
* @param Object $node The content that was created/updated/deleted
*/
public static function single_page_worker($node) {
$page_link = url('node/' . $node->nid, array(
'absolute' => TRUE,
));
if (isset($page_link)) {
$single_page_job_url = ShareaholicUtilities::CM_API_URL . '/jobs/uber_single_page';
$data = '{"args":["' . $page_link . '", {"force": true}]}';
$options = array(
'method' => 'POST',
'data' => $data,
'headers' => array(
'Content-Type' => 'application/json',
),
);
$response = drupal_http_request($single_page_job_url, $options);
}
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ShareaholicContentManager:: |
public static | function | Wrapper for the Shareaholic Content Manager Single Domain worker API | |
ShareaholicContentManager:: |
public static | function | Wrapper for the Shareaholic Content Manager Single Page worker API |