Skip to content

Commit

Permalink
more stubbing out of push functions
Browse files Browse the repository at this point in the history
  • Loading branch information
thisisaaronland committed Jun 1, 2012
1 parent 61510ce commit 0935605
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions www/include/lib_instagram_push.php
@@ -1,5 +1,7 @@
<?php

$GLOBALS['cfg']['instagram_push_endpoint'] = 'https://api.instagram.com/v1/subscriptions/';

#################################################################

function instagram_push_topic_map($string_keys=0){
Expand All @@ -19,4 +21,28 @@ function instagram_push_topic_map($string_keys=0){
}

#################################################################

function instagram_push_subscribe(&$subscription){

$type_map = instagram_push_type_map();
$object = $type_map[$subscription['type_id']];

$callback = "$GLOBALS['cfg']['asb_root_url']}push/{$subscription['secret_url']}/";

$params = array(
'client_id' => $GLOBALS['cfg']['instagram_oauth_key'],
'client_secret' => $GLOBALS['cfg']['instagram_oauth_secret'],
'object' => $object,
'aspect' => 'media',
'verify_token' => $subscription['verify_token'],
'callback_url' => $callback,
);

$url = $GLOBALS['instagram_push_endpoint'];

$ret = http_post($url, $params);
return $ret;
}

#################################################################
?>

0 comments on commit 0935605

Please sign in to comment.