getGUID(); $access_key = elgg_get_plugin_user_setting('access_key', $user_guid, 'gnusocial_api'); $access_secret = elgg_get_plugin_user_setting('access_secret', $user_guid, 'gnusocial_api'); if (!($access_key && $access_secret)) { return; } $api = gnusocial_api_get_api_object($access_key, $access_secret); if (!$api) { return; } $api->post('statuses/update', array('status' => $params['message'])); } /** * Get tweets for a user. * * @param int $user_guid The Elgg user GUID * @param array $options * @return array */ function gnusocial_api_fetch_tweets($user_guid, $options = array()) { // check user settings $access_key = elgg_get_plugin_user_setting('access_key', $user_guid, 'gnusocial_api'); $access_secret = elgg_get_plugin_user_setting('access_secret', $user_guid, 'gnusocial_api'); if (!($access_key && $access_secret)) { return FALSE; } $api = gnusocial_api_get_api_object($access_key, $access_secret); if (!$api) { return FALSE; } return $api->get('statuses/user_timeline', $options); } /** * Register as public pages for walled garden. * * @param string $hook * @param string $type * @param array $return_value * @param array $params * @return array */ function gnusocial_api_public_pages($hook, $type, $return_value, $params) { $return_value[] = 'gnusocial_api/forward'; $return_value[] = 'gnusocial_api/login'; return $return_value; }