package.xml 0000664 0001750 0001750 00000113572 12227214576 011320 0 ustar jan jan
';
// }
/** Calling code that requires extended permissions **/
//try {
// // Set your Facebook status (requires 'status_update' extended perm)
// $facebook->users->setStatus('is testing my Horde_Service_Facebook client library code...again.');
//} catch (Horde_Service_Facebook_Exception $e) {
// // Check that we failed because of insufficient app permissions.
// // then redirect if needed...
// if ($e->getCode() == Horde_Service_Facebook_ErrorCodes::API_EC_PERMISSION_STATUS_UPDATE) {
// // Don't have status_update...tell user/provide link to authorize page etc...
// You can get the link to the authorize page like this:
// $facebook->auth->getExtendedPermUrl(
// Horde_Service_Facebook_Auth::EXTEND_PERMS_STATUSUPDATE,
// 'http://yourcallbackurl.com');
// } else {
// // Something else
// echo $e->getMessage();
// }
//}
/**
* Alternatively, you could check for the necessary perms first, but IMO, it's
* more effecient to get the error since checking the perms and then performing
* the action require two round trips to the server.
*/
//$hasPerm = $facebook->users->hasAppPermissions('status_update');
//if ($hasPerm) {
// //.....
//}
/**
* Batch mode.
* When calling in batch mode, you must assign the results of the method calls
* as a reference so when run() is called, you still have a handle to the
* results.
*/
//$facebook->batchBegin();
//$notifications = &$facebook->notifications->get();
//$friends = &$facebook->friends->get();
//$facebook->batchEnd();
//var_dump($friends);
//var_dump($notifications);
/**
* View a user's pictures. $uid should be the user id whose albums you want to
* retrieve. (Permissions permitting, of course)
*/
//$albums = $facebook->photos->getAlbums($uid);
//var_dump($albums);
//$images = $facebook->photos->get('', $albums[0]['aid']);
//var_dump($images);
/**
* Request the raw JSON (or XML) data
*/
//$facebook->dataFormat = Horde_Service_Facebook::DATA_FORMAT_JSON;
//$results = $facebook->photos->getAlbums($uid);
//var_dump($results);
/**
* Upload a photo
*/
$path = "/Users/mrubinsk/Desktop/horde_fb.jpg";
$results = $facebook->photos->upload($path);
var_dump($results); Horde_Service_Facebook-2.0.6/doc/Horde/Service/Facebook/COPYING 0000664 0001750 0001750 00000002430 12227214576 022116 0 ustar jan jan Copyright 1999-2013 Horde LLC. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE HORDE PROJECT
OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Horde_Service_Facebook-2.0.6/doc/Horde/Service/Facebook/UPGRADING 0000664 0001750 0001750 00000005651 12227214576 022336 0 ustar jan jan =================================
Upgrading Horde_Service_Facebook
=================================
:Contact: dev@lists.horde.org
.. contents:: Contents
.. section-numbering::
This lists the API changes between releases of the package.
Upgrading to 2.0.0
==================
Batch processing has been removed until it can be ported to the Graph API.
- Horde_Service_Facebook
- callUploadMethod()
This method has been removed. You should use the upload method of the
request object directly.
- Horde_Service_Facebook_Events
- get()
This method now takes a parameter array in place of numerous default
parameters.
- getMembers()
This method now returns an array of objects representing all invited users
in place of separate arrays for each rsvp_status type.
- create()
This method now requires a $uid parameter.
- edit()
This method has been removed since Facebook no longer allows editng user
events via the API.
- Horde_Service_Facebook_Notes
- delete()
This method no longer takes a $uid argument.
- edit()
This method has been removed.
- Horde_Service_Facebook_Notifications
- send(), sendEmail()
These methods have been removed since they are no longer supported by
Facebook. The get() method is still supported, but is not yet available
in the Graph API so it is left untouched.
- Horde_Service_Facebook_Photos
- upload()
This method now takes a parameter array in place of multiple, optional
parameters.
- Horde_Service_Facebook_Streams
- get()
This method has been removed and replaced by both getWall() and getStream().
- getComments()
This method has been removed. Comments are now returned in getWall() and
getStream() calls.
- publish()
This method has been removed. You should use e.g., post() instead.
- remove()
This method was renamed to delete() to match the GraphAPI method name.
- addComment(), removeComment(), addLike(), removeLike()
The $uid parameter has been removed since it is no longer possible to
post as another user from the GraphAPI.
- getFilters()
The $uid paramter is now required.
- Horde_Service_Facebook_Users
- hasAppPermission()
This method has been removed. Use the new getAppPermissions() instead.
This returns an array of all application permissions.
- isAppUser()
This method has been removed. Use the new getAppPermissions() method
instead.
- getStandardInfo()
This method has been removed.
- getInfo()
This method now only request user info for a single user at a time.
- isVerified()
This method has been removed. Use getInfo() instead.
- setStatus()
This method was removed. Use the Horde_Service_Facebook_Streams::post
method instead.
- getStatus()
This method was removed.
Horde_Service_Facebook-2.0.6/lib/Horde/Service/Facebook/Request/Base.php 0000664 0001750 0001750 00000003114 12227214576 024077 0 ustar jan jan
* @category Horde
* @package Service_Facebook
*/
abstract class Horde_Service_Facebook_Request_Base
{
/**
*
* @var Horde_Service_Facebook
*/
protected $_facebook;
/**
*
* @var Horde_Http_Client
*/
protected $_http;
/**
* The current method being processed.
*
* @var string
*/
protected $_method;
/**
* The method parameters for the current method call.
*
* @var array
*/
protected $_params;
/**
* Const'r
*
* @param Horde_Service_Facebook $facebook
* @param string $method
* @param array $params
*
*/
public function __construct($facebook, $method, array $params = array())
{
$this->_facebook = $facebook;
$this->_http = $facebook->http;
$this->_method = $method;
$this->_params = $params;
}
/**
* Run this request and return the data.
*
* @return array The results of the request.
*
* @throws Horde_Service_Facebook_Exception
*/
abstract public function run();
/**
* Perform a multipart/form-data upload.
*
* @param array $options An options array:
* - params: (array) Form parameters to pass
* - file: (string) Local path to the file
*/
abstract public function upload(array $options = array());
} Horde_Service_Facebook-2.0.6/lib/Horde/Service/Facebook/Request/Graph.php 0000664 0001750 0001750 00000011554 12227214576 024275 0 ustar jan jan
* @category Horde
* @package Service_Facebook
*/
class Horde_Service_Facebook_Request_Graph extends Horde_Service_Facebook_Request_Base
{
/**
* API Endpoint to call.
*
* @var string
*/
protected $_endpoint;
/**
* The HTTP method to use for this request.
*
* @var
*/
protected $_request = 'GET';
/**
* Raw POST data.
*
* @var string
*/
protected $_raw;
/**
* Const'r
*
* @param Horde_Service_Facebook $facebook The facebook client.
* @param string $method The API method to call.
* @param array $params Any parameters to send.
* @param array $options Additional options:
* - request (string) The HTTP method to use.
* DEFAULT: GET
*/
public function __construct(
$facebook, $method = '', array $params = array(), array $options = array())
{
parent::__construct($facebook, $method, $params);
$this->_endpoint = new Horde_Url($facebook->getFacebookUrl('graph') . '/' . $this->_method);
if (!empty($options['request'])) {
$this->_request = $options['request'];
}
$this->_params['access_token'] = $this->_facebook->auth->getSessionKey();
}
/**
* Perform a multipart/form-data upload.
*
* @param array $options An options array:
* - params: (array) Form parameters to pass
* - file: (string) Local path to the file
*/
public function upload(array $options = array())
{
// the format of this message is specified in RFC1867/RFC1341.
// we add twenty pseudo-random digits to the end of the boundary string.
$boundary = '--------------------------FbMuLtIpArT' .
sprintf("%010d", mt_rand()) .
sprintf("%010d", mt_rand());
$content_type = 'multipart/form-data; boundary=' . $boundary;
// within the message, we prepend two extra hyphens.
$delimiter = '--' . $boundary;
$close_delimiter = $delimiter . '--';
$content_lines = array();
$params = array_merge($options['params'], $this->_params);
foreach ($params as $key => $val) {
$content_lines[] = $delimiter;
$content_lines[] = 'Content-Disposition: form-data; name="' . $key . '"';
$content_lines[] = '';
$content_lines[] = $val;
}
// now add the file data
$content_lines[] = $delimiter;
$content_lines[] = 'Content-Disposition: form-data; filename="' . basename($options['file']) . '"';
$content_lines[] = 'Content-Type: application/octet-stream';
$content_lines[] = '';
$content_lines[] = file_get_contents($options['file']);
$content_lines[] = $close_delimiter;
$content_lines[] = '';
$content = implode("\r\n", $content_lines);
try {
$result = $this->_http->request('POST',
$this->_endpoint->toString(true),
$content,
array(
'Content-Type' => $content_type ,
'Content-Length' => strlen($content)
)
);
} catch (Horde_Http_Exception $e) {
throw new Horde_Service_Facebook_Exception(sprintf(Horde_Service_Facebook_Translation::t("Upload failed: %s"), $e->getMessage()));
}
if ($result->code != '200') {
throw new Horde_Service_Facebook_Exception($result->getBody());
}
return json_decode($result->getBody());
}
/**
* Run this request and return the data.
*
* @return mixed Either raw JSON, or an array of decoded values.
* @throws Horde_Service_Facebook_Exception
*/
public function run()
{
if ($this->_request != 'POST') {
$this->_endpoint->add($this->_params);
$params = array();
} else {
$params = $this->_params;
}
try {
$result = $this->_http->request($this->_request, $this->_endpoint->toString(true), $params);
} catch (Horde_Http_Exception $e) {
$this->_facebook->logger->err($e->getMessage());
throw new Horde_Service_Facebook_Exception($e);
}
if ($result->code != '200') {
$body = $result->getBody();
if (($error = json_decode($body, true)) &&
isset($error['error']['message'])) {
throw new Horde_Service_Facebook_Exception($error['error']['message']);
}
throw new Horde_Service_Facebook_Exception($body);
}
return json_decode($result->getBody());
}
}
Horde_Service_Facebook-2.0.6/lib/Horde/Service/Facebook/Request/Rest.php 0000664 0001750 0001750 00000010472 12227214576 024147 0 ustar jan jan
* @category Horde
* @package Service_Facebook
*/
class Horde_Service_Facebook_Request_Rest extends Horde_Service_Facebook_Request_Base
{
/**
* Run this request and return the data.
*
* @return array The results of the request.
*
* @throws Horde_Service_Facebook_Exception
*/
public function run()
{
$data = $this->_postRequest($this->_method, $this->_params);
if (defined('JSON_BIGINT_AS_STRING')) {
$result = json_decode($data, true, 512, constant('JSON_BIGINT_AS_STRING'));
} else {
if (is_numeric($data)) {
$result = $data;
} else {
$result = json_decode($data, true);
}
}
if (is_array($result) && isset($result['error_code'])) {
throw new Horde_Service_Facebook_Exception($result['error_msg'], $result['error_code']);
}
return $result;
}
/**
* Perform a multipart/form-data upload.
*
* @param array $options An options array:
* - params: (array) Form parameters to pass
* - file: (string) Local path to the file
*/
public function upload(array $options = array())
{
throw new Horde_Service_Facebook_Exception('Deprecated');
}
/**
* Send a POST request
*
* @param string $method The method to call.
* @param array $params The method parameters.
*
* @return string The request results
* @throws Horde_Service_Facebook_Exception
*/
protected function _postRequest($method, &$params)
{
$this->_finalizeParams($params);
try {
$url = new Horde_Url(Horde_Service_Facebook::REST_SERVER_ADDR . $method);
$result = $this->_http->request('POST', $url->toString(), $this->_createPostString($params));
} catch (Exception $e) {
$this->_facebook->logger->err($e->getMessage());
throw new Horde_Service_Facebook_Exception(Horde_Service_Facebook_Translation::t("Facebook service is unavailable. Please try again later."));
}
return $result->getBody();
}
/**
* Finalize, sanity check, standardze and sign the method parameters, $params
*
* @param string $method The method name
* @param array $params Method parameters
*
* @return void
*/
protected function _finalizeParams(&$params)
{
// Run through the params and see if any of them are arrays. If so,
// json encode them, as per the new Facebook API guidlines.
// http://www.facebook.com/developers/message.php#msg_351
foreach ($params as &$param) {
if (is_array($param)) {
$param = json_encode($param);
}
}
$this->_addStandardParams($params);
}
/**
* Adds standard facebook api parameters to $params
*
* @param array $params Method parameters
*
* @return void
*/
protected function _addStandardParams(&$params)
{
$params['access_token'] = $this->_facebook->auth->getSessionKey();
$params['format'] = 'json';
if (!isset($params['v'])) {
$params['v'] = '1.0';
}
if (!empty($this->_facebook->useSslResources)) {
$params['return_ssl_resources'] = true;
}
}
/**
* Helper function to convert array to CSV string
*
* @param array $params
* @return string
*/
protected function _convertToCsv(&$params)
{
foreach ($params as $key => &$val) {
if (is_array($val)) {
$val = implode(',', $val);
}
}
}
/**
* Create a string suitable for sending as POST data.
*
* TODO: Figure out why using http_build_query doesn't work here.
*
* @param array $params The parameters array
*
* @return string The POST string
*/
protected function _createPostString($params)
{
$post_params = array();
foreach ($params as $key => &$val) {
$post_params[] = $key.'='.urlencode($val);
}
return implode('&', $post_params);
}
} Horde_Service_Facebook-2.0.6/lib/Horde/Service/Facebook/Auth.php 0000664 0001750 0001750 00000012754 12227214576 022510 0 ustar jan jan
* @category Horde
* @package Service_Facebook
*/
class Horde_Service_Facebook_Auth extends Horde_Service_Facebook_Base
{
/**
* Cache the current auth_token.
*
* @var string
*/
protected $_sessionKey;
/** User Data Perms **/
const EXTEND_PERMS_USER_ABOUT = 'user_about_me';
const EXTEND_PERMS_USER_BIRTHDAY = 'user_birthday';
const EXTEND_PERMS_USER_EVENTS = 'user_events';
const EXTEND_PERMS_USER_HOMETOWN = 'user_hometown';
const EXTEND_PERMS_USER_LOCATION = 'user_location';
const EXTEND_PERMS_USER_PHOTOS = 'user_photos';
/** Friends Data **/
const EXTEND_PERMS_FRIENDS_ABOUT = 'friends_about_me';
const EXTEND_PERMS_FRIENDS_BIRTHDAY = 'friends_birthday';
const EXTEND_PERMS_FRIENDS_HOMETOWN = 'friends_hometown';
const EXTEND_PERMS_FRIENDS_LOCATION = 'friends_location';
const EXTEND_PERMS_FRIENDS_PHOTOS = 'friends_photos';
/** Misc **/
const EXTEND_PERMS_PUBLISHSTREAM = 'publish_stream';
const EXTEND_PERMS_READSTREAM = 'read_stream';
/**
* Get the URL for the user to authenticate the application and authorize
* various extender permissions/
*
* @param string $callback The callback url. FB will redirect back to here.
* @param array $perms An array of FB permissions to request.
* @param string $state A random, but unique string for FB to return
* to ensure security.
*
* @return string The URL.
*/
public function getOAuthUrl($callback, array $perms = array(), $state = null)
{
return $this->_facebook->getFacebookUrl()
. '/dialog/oauth?client_id=' . $this->_facebook->appId
. '&redirect_uri=' . urlencode($callback)
. '&scope=' . implode(',', $perms)
. (!empty($state) ? '&state=' . $state : '');
}
/**
* Returns the URL to obtain the auth_token from FB after getOAuthUrl
* redirects back to your callback URL.
*
* @param string $code The code returned by FB after the OAuth2 dialog
* @param string $callback The callback url. Required in order to
* authenticate via OAuth2.
*
* @return string The URL.
*/
public function getAuthTokenUrl($code, $callback)
{
return $this->_facebook->getFacebookUrl('graph')
. '/oauth/access_token?client_id=' . $this->_facebook->appId
. '&redirect_uri=' . urlencode($callback) . '&client_secret=' . $this->_facebook->secret
. '&code=' . $code;
}
/**
* Obtain the current access_token. Either returns the currently set token
* or, if a OAuth2 code is provided, sends a GET request to FB requesting
* the access_token.
*
* @param string $code The code returned from FB's OAuth dialog.
* @param string $callback If provided, used as the callback URL required
* during the final steps in the OAuth2 process.
*
* @return string The access_token
* @throws Horde_Service_Facebook_Exception
*/
public function getSessionKey($code = null, $callback = '')
{
if (!empty($code)) {
try {
$result = $this->_http->request(
'GET', $this->getAuthTokenUrl($code, $callback));
} catch (Horde_Http_Exception $e) {
throw new Horde_Service_Facebook_Exception($e);
}
if ($result->code !== 200) {
throw new Horde_Service_Facebook_Exception('Unable to contact Facebook', $result->code);
}
parse_str($result->getBody(), $vars);
$this->_sessionKey = $vars['access_token'];
}
return $this->_sessionKey;
}
/**
* Sets an existing access_token for this session.
*
* @param string $sessionKey The FB OAuth2 access_token
*/
public function setSession($sessionKey)
{
$this->_sessionKey = $sessionKey;
}
/**
* Revoke a previously authorizied extended permission
*
* @param string $perm The extended permission to remove.
*
* @return unknown_type
*/
public function revokeExtendedPermission($perm)
{
// Session key is *required*
if (!$skey = $this->getSessionKey()) {
throw new Horde_Service_Facebook_Exception(
'session_key is required',
Horde_Service_Facebook_ErrorCodes::API_EC_SESSION_REQUIRED);
}
return $this->_facebook->callGraphApi(
'me/permissions',
array('permission' => $perm),
array('request' => 'DELETE')
);
}
/**
* Returns the user corresponding to the current session object.
*
* @throws Horde_Service_Facebook_Exception
* @return string User id
*/
public function getLoggedInUser()
{
if (empty($this->_sessionKey)) {
throw new Horde_Service_Facebook_Exception(
'users.getLoggedInUser requires a session_key',
Horde_Service_Facebook_ErrorCodes::API_EC_PARAM_SESSION_KEY);
}
$results = $this->_facebook->callGraphApi('me');
return $results->id;
}
}
Horde_Service_Facebook-2.0.6/lib/Horde/Service/Facebook/Base.php 0000664 0001750 0001750 00000001255 12227214576 022453 0 ustar jan jan
* @category Horde
* @package Service_Facebook
*/
class Horde_Service_Facebook_Base
{
/**
*
* @var Horde_Service_Facebook
*/
protected $_facebook;
/**
*
* @var Horde_Http_Client
*/
protected $_http;
/**
* Constructor
*
* @param Horde_Service_Facebook $facebook
*/
public function __construct(Horde_Service_Facebook $facebook)
{
$this->_facebook = $facebook;
$this->_http = $facebook->http;
}
} Horde_Service_Facebook-2.0.6/lib/Horde/Service/Facebook/ErrorCodes.php 0000664 0001750 0001750 00000015556 12227214576 023661 0 ustar jan jan
* @category Horde
* @package Service_Facebook
*/
class Horde_Service_Facebook_ErrorCodes
{
const API_EC_SUCCESS = 0;
/*
* GENERAL ERRORS
*/
const API_EC_UNKNOWN = 1;
const API_EC_SERVICE = 2;
const API_EC_METHOD = 3;
const API_EC_TOO_MANY_CALLS = 4;
const API_EC_BAD_IP = 5;
const API_EC_HOST_API = 6;
const API_EC_HOST_UP = 7;
const API_EC_SECURE = 8;
const API_EC_RATE = 9;
const API_EC_PERMISSION_DENIED = 10;
const API_EC_DEPRECATED = 11;
const API_EC_VERSION = 12;
/*
* PARAMETER ERRORS
*/
const API_EC_PARAM = 100;
const API_EC_PARAM_API_KEY = 101;
const API_EC_PARAM_SESSION_KEY = 102;
const API_EC_PARAM_CALL_ID = 103;
const API_EC_PARAM_SIGNATURE = 104;
const API_EC_PARAM_TOO_MANY = 105;
const API_EC_PARAM_USER_ID = 110;
const API_EC_PARAM_USER_FIELD = 111;
const API_EC_PARAM_SOCIAL_FIELD = 112;
const API_EC_PARAM_EMAIL = 113;
const API_EC_PARAM_USER_ID_LIST = 114;
const API_EC_PARAM_ALBUM_ID = 120;
const API_EC_PARAM_PHOTO_ID = 121;
const API_EC_PARAM_FEED_PRIORITY = 130;
const API_EC_PARAM_CATEGORY = 140;
const API_EC_PARAM_SUBCATEGORY = 141;
const API_EC_PARAM_TITLE = 142;
const API_EC_PARAM_DESCRIPTION = 143;
const API_EC_PARAM_BAD_JSON = 144;
const API_EC_PARAM_BAD_EID = 150;
const API_EC_PARAM_UNKNOWN_CITY = 151;
const API_EC_PARAM_BAD_PAGE_TYPE = 152;
/*
* USER PERMISSIONS ERRORS
*/
const API_EC_PERMISSION = 200;
const API_EC_PERMISSION_USER = 210;
const API_EC_PERMISSION_ALBUM = 220;
const API_EC_PERMISSION_PHOTO = 221;
const API_EC_PERMISSION_MESSAGE = 230;
const API_EC_PERMISSION_OTHER_USER = 240;
const API_EC_PERMISSION_STATUS_UPDATE = 250;
const API_EC_PERMISSION_PHOTO_UPLOAD = 260;
const API_EC_PERMISSION_VIDEO_UPLOAD = 261;
const API_EC_PERMISSION_SMS = 270;
const API_EC_PERMISSION_CREATE_LISTING = 280;
const API_EC_PERMISSION_CREATE_NOTE = 281;
const API_EC_PERMISSION_SHARE_ITEM = 282;
const API_EC_PERMISSION_EVENT = 290;
const API_EC_PERMISSION_LARGE_FBML_TEMPLATE = 291;
const API_EC_PERMISSION_LIVEMESSAGE = 292;
const API_EC_PERMISSION_RSVP_EVENT = 299;
/*
* DATA EDIT ERRORS
*/
const API_EC_EDIT = 300;
const API_EC_EDIT_USER_DATA = 310;
const API_EC_EDIT_PHOTO = 320;
const API_EC_EDIT_ALBUM_SIZE = 321;
const API_EC_EDIT_PHOTO_TAG_SUBJECT = 322;
const API_EC_EDIT_PHOTO_TAG_PHOTO = 323;
const API_EC_EDIT_PHOTO_FILE = 324;
const API_EC_EDIT_PHOTO_PENDING_LIMIT = 325;
const API_EC_EDIT_PHOTO_TAG_LIMIT = 326;
const API_EC_EDIT_ALBUM_REORDER_PHOTO_NOT_IN_ALBUM = 327;
const API_EC_EDIT_ALBUM_REORDER_TOO_FEW_PHOTOS = 328;
const API_EC_MALFORMED_MARKUP = 329;
const API_EC_EDIT_MARKUP = 330;
const API_EC_EDIT_FEED_TOO_MANY_USER_CALLS = 340;
const API_EC_EDIT_FEED_TOO_MANY_USER_ACTION_CALLS = 341;
const API_EC_EDIT_FEED_TITLE_LINK = 342;
const API_EC_EDIT_FEED_TITLE_LENGTH = 343;
const API_EC_EDIT_FEED_TITLE_NAME = 344;
const API_EC_EDIT_FEED_TITLE_BLANK = 345;
const API_EC_EDIT_FEED_BODY_LENGTH = 346;
const API_EC_EDIT_FEED_PHOTO_SRC = 347;
const API_EC_EDIT_FEED_PHOTO_LINK = 348;
const API_EC_EDIT_VIDEO_SIZE = 350;
const API_EC_EDIT_VIDEO_INVALID_FILE = 351;
const API_EC_EDIT_VIDEO_INVALID_TYPE = 352;
const API_EC_EDIT_VIDEO_FILE = 353;
const API_EC_EDIT_FEED_TITLE_ARRAY = 360;
const API_EC_EDIT_FEED_TITLE_PARAMS = 361;
const API_EC_EDIT_FEED_BODY_ARRAY = 362;
const API_EC_EDIT_FEED_BODY_PARAMS = 363;
const API_EC_EDIT_FEED_PHOTO = 364;
const API_EC_EDIT_FEED_TEMPLATE = 365;
const API_EC_EDIT_FEED_TARGET = 366;
const API_EC_EDIT_FEED_MARKUP = 367;
/**
* SESSION ERRORS
*/
const API_EC_SESSION_TIMED_OUT = 450;
const API_EC_SESSION_METHOD = 451;
const API_EC_SESSION_INVALID = 452;
const API_EC_SESSION_REQUIRED = 453;
const API_EC_SESSION_REQUIRED_FOR_SECRET = 454;
const API_EC_SESSION_CANNOT_USE_SESSION_SECRET = 455;
/**
* FQL ERRORS
*/
const FQL_EC_UNKNOWN_ERROR = 600;
const FQL_EC_PARSER = 601; // backwards compatibility
const FQL_EC_PARSER_ERROR = 601;
const FQL_EC_UNKNOWN_FIELD = 602;
const FQL_EC_UNKNOWN_TABLE = 603;
const FQL_EC_NOT_INDEXABLE = 604; // backwards compatibility
const FQL_EC_NO_INDEX = 604;
const FQL_EC_UNKNOWN_FUNCTION = 605;
const FQL_EC_INVALID_PARAM = 606;
const FQL_EC_INVALID_FIELD = 607;
const FQL_EC_INVALID_SESSION = 608;
const FQL_EC_UNSUPPORTED_APP_TYPE = 609;
const FQL_EC_SESSION_SECRET_NOT_ALLOWED = 610;
const API_EC_REF_SET_FAILED = 700;
/**
* DATA STORE API ERRORS
*/
const API_EC_DATA_UNKNOWN_ERROR = 800;
const API_EC_DATA_INVALID_OPERATION = 801;
const API_EC_DATA_QUOTA_EXCEEDED = 802;
const API_EC_DATA_OBJECT_NOT_FOUND = 803;
const API_EC_DATA_OBJECT_ALREADY_EXISTS = 804;
const API_EC_DATA_DATABASE_ERROR = 805;
const API_EC_DATA_CREATE_TEMPLATE_ERROR = 806;
const API_EC_DATA_TEMPLATE_EXISTS_ERROR = 807;
const API_EC_DATA_TEMPLATE_HANDLE_TOO_LONG = 808;
const API_EC_DATA_TEMPLATE_HANDLE_ALREADY_IN_USE = 809;
const API_EC_DATA_TOO_MANY_TEMPLATE_BUNDLES = 810;
const API_EC_DATA_MALFORMED_ACTION_LINK = 811;
const API_EC_DATA_TEMPLATE_USES_RESERVED_TOKEN = 812;
/*
* APPLICATION INFO ERRORS
*/
const API_EC_NO_SUCH_APP = 900;
/*
* BATCH ERRORS
*/
const API_EC_BATCH_TOO_MANY_ITEMS = 950;
const API_EC_BATCH_ALREADY_STARTED = 951;
const API_EC_BATCH_NOT_STARTED = 952;
const API_EC_BATCH_METHOD_NOT_ALLOWED_IN_BATCH_MODE = 953;
/*
* EVENT API ERRORS
*/
const API_EC_EVENT_INVALID_TIME = 1000;
/*
* INFO BOX ERRORS
*/
const API_EC_INFO_NO_INFORMATION = 1050;
const API_EC_INFO_SET_FAILED = 1051;
/*
* LIVEMESSAGE API ERRORS
*/
const API_EC_LIVEMESSAGE_SEND_FAILED = 1100;
const API_EC_LIVEMESSAGE_EVENT_NAME_TOO_LONG = 1101;
const API_EC_LIVEMESSAGE_MESSAGE_TOO_LONG = 1102;
/*
* CONNECT SESSION ERRORS
*/
const API_EC_CONNECT_FEED_DISABLED = 1300;
/*
* Platform tag bundles errors
*/
const API_EC_TAG_BUNDLE_QUOTA = 1400;
/*
* SHARE
*/
const API_EC_SHARE_BAD_URL = 1500;
/*
* NOTES
*/
const API_EC_NOTE_CANNOT_MODIFY = 1600;
/*
* COMMENTS
*/
const API_EC_COMMENTS_UNKNOWN = 1700;
const API_EC_COMMENTS_POST_TOO_LONG = 1701;
const API_EC_COMMENTS_DB_DOWN = 1702;
const API_EC_COMMENTS_INVALID_XID = 1703;
const API_EC_COMMENTS_INVALID_UID = 1704;
const API_EC_COMMENTS_INVALID_POST = 1705;
}
Horde_Service_Facebook-2.0.6/lib/Horde/Service/Facebook/Events.php 0000664 0001750 0001750 00000011744 12227214576 023051 0 ustar jan jan
* @category Horde
* @package Service_Facebook
*/
class Horde_Service_Facebook_Events extends Horde_Service_Facebook_Base
{
/**
* Returns events according to the filters specified.
*
* @param array $options The filter options:
* - uid: (string) The user id.
* - eids: (string) Comma delimited list of event ids to filter on.
* - start: (integer) Only return events occuring after this timestamp.
* - end: (integet) Only return events occuring before this timestamp.
* - rsvp: (string) Only return events if uid is specified and the user
* has this rsvp status.
*
* @return array The events matching the query.
*/
public function get($options = array())
{
$defaults = array('uid' => 'me()');
$options = array_merge($defaults, $options);
$fql = 'SELECT eid, name, pic_square, pic_small, '
. 'pic_big, pic, host, description,'
. 'start_time, end_time, creator, update_time, location, venue, '
. 'privacy, hide_guest_list FROM event WHERE eid IN';
if (!empty($options['rsvp'])) {
$fql .= ' (SELECT eid FROM event_member WHERE uid=' . $options['uid']
. ' AND rsvp_status=\'' . $options['rsvp'] . '\')';
} else {
$fql .= ' (SELECT eid FROM event_member WHERE uid=' . $options['uid'] . ')';
}
if (!empty($options['eids'])) {
$fql .= ' AND eid IN (' . implode(',', $options['eids']) . ')';
}
if (!empty($options['start'])) {
$fql .= ' AND start_time>=' . $options['start'];
}
if (!empty($options['end'])) {
$fql .= ' AND start_time<=' . $options['end'];
}
// Get the events
$events = $this->_facebook->fql->run($fql);
// If no requested status, query to get the current statuses.
if (empty($options['rsvp'])) {
$eids = array();
foreach ($events as $e) {
$eids[] = $e['eid'];
}
$fql = 'SELECT eid, rsvp_status FROM event_member WHERE uid=' . $options['uid']
. ' AND eid IN (' . implode(',', $eids) . ')';
$status = $this->_facebook->fql->run($fql);
foreach ($events as &$e) {
foreach ($status as $s) {
if ($s['eid'] == $e['eid']) {
$e['rsvp_status'] = $this->_fromDriverStatus($s['rsvp_status']);
}
}
}
} else {
// Otherwise, we already know the status.
foreach ($events as &$e) {
$e['rsvp_status'] = $this->_fromDriverStatus($rsvp_status);
}
}
return $events;
}
protected function _fromDriverStatus($driver_status)
{
switch ($driver_status) {
case 'attending':
return 'confirmed';
case 'unsure':
return 'tentative';
case 'declined':
case 'not_replied':
return 'free';
}
}
/**
* Returns membership list data associated with an event.
*
* @param integer $eid event id
*
* @return array An array of objects with 'name', 'id', and 'rsvp_status'
* values.
*/
public function getMembers($eid)
{
return $this->_facebook->callGraphApi($eid . '/invited');
}
/**
* RSVPs the current user to this event.
*
* @param integer $eid event id
* @param string $rsvp 'attending', 'maybe', or 'declined'
*
* @return boolean
*/
public function rsvp($eid, $rsvp)
{
if (!in_array($rsvp, array('attending', 'maybe', 'declined'))) {
throw InvalidArgumentException();
}
return $this->_facebook->callGraphApi(
$eid . '/' . $rsvp,
array(),
array('request' => 'POST'));
}
/**
* Cancels an event. Only works for events where application is the admin.
*
* @param integer $eid event id
*
* @return boolean
*/
public function cancel($eid, $cancel_message = '')
{
return $this->_facebook->callGraphApi(
$eid,
array(),
array('request' => 'DELETE'));
}
/**
* Creates an event on behalf of the user is there is a session, otherwise on
* behalf of app. Successful creation guarantees app will be admin.
*
* @param string $uid The facebook id the event is attached to.
* @param array $event_info json encoded event information
*
* @return integer event id
*/
public function create($uid, array $event_info)
{
return $this->_facebook->callGraphApi(
$uid . '/events',
$event_info,
array('request' => 'POST'));
}
} Horde_Service_Facebook-2.0.6/lib/Horde/Service/Facebook/Exception.php 0000664 0001750 0001750 00000000370 12227214576 023534 0 ustar jan jan
* @category Horde
* @package Service_Facebook
*/
class Horde_Service_Facebook_Exception extends Horde_Exception_Wrapped
{
} Horde_Service_Facebook-2.0.6/lib/Horde/Service/Facebook/Fql.php 0000664 0001750 0001750 00000001320 12227214576 022314 0 ustar jan jan
* @category Horde
* @package Service_Facebook
*/
class Horde_Service_Facebook_Fql extends Horde_Service_Facebook_Base
{
/**
* Run a FQL query, optionally including the current session_key.
*
* http://developers.facebook.com/documentation.php?v=1.0&doc=fql
*
* @param string $query The FQL to run.
*
* @return array Hashes containing results.
*/
public function run($query)
{
$params = array('query' => $query);
return $this->_facebook->callMethod('facebook.fql.query', $params);
}
} Horde_Service_Facebook-2.0.6/lib/Horde/Service/Facebook/Friends.php 0000664 0001750 0001750 00000003177 12227214576 023200 0 ustar jan jan
* @category Horde
* @package Service_Facebook
*/
class Horde_Service_Facebook_Friends extends Horde_Service_Facebook_Base
{
/**
* Returns whether or not pairs of users are friends.
* Note that the Facebook friend relationship is symmetric.
*
* @param string $uid user id to check
* @param string $friend_id Id of user to check for friend status.
*
* @return boolean
*/
public function areFriends($uid, $friend_id)
{
$results = $this->_facebook->callGraphApi($uid . '/friends/' . $friend_id);
return !empty($results->data);
}
/**
* Returns the friends of the current session user.
*
* @param string $uid The uid to obtain friends for.
* @param string $list Return only friends in the specified list.
*
* @return array An array of friend objects containing 'name' and 'id'
* properties.
*/
public function get($uid, $list = null)
{
if (!empty($list)) {
return $this->_facebook->callGraphApi($list);
}
return $this->_facebook->callGraphApi($uid . '/friends');
}
/**
* Returns the set of friend lists for the current session user.
*
* @param string $uid The uid to obtain friend lists for.
*
* @return array An array of friend list objects
*/
public function getLists($uid)
{
return $this->_facebook->callGraphApi($uid . '/friendlists');
}
} Horde_Service_Facebook-2.0.6/lib/Horde/Service/Facebook/Groups.php 0000664 0001750 0001750 00000002670 12227214576 023062 0 ustar jan jan
* @category Horde
* @package Service_Facebook
*/
class Horde_Service_Facebook_Groups extends Horde_Service_Facebook_Base
{
/**
* Returns groups according to the filters specified.
*
* @param string $uid User associated with groups.
*
* @return array An array of group objects
*/
public function get($uid)
{
if (!$this->_facebook->auth->getSessionKey()) {
throw new Horde_Service_Facebook_Exception(
'session_key is required',
Horde_Service_Facebook_ErrorCodes::API_EC_SESSION_REQUIRED);
}
return $this->_facebook->callGraphApi($uid . '/groups');
}
/**
* Returns the membership list of a group.
*
* @param integer $gid Group id
*
* @return array An array with four membership lists, with keys 'members',
* 'admins', 'officers', and 'not_replied'
*/
public function getMembers($gid)
{
// Session key is *required*
if ($this->_facebook->auth->getSessionKey()) {
throw new Horde_Service_Facebook_Exception(
'session_key is required',
Horde_Service_Facebook_ErrorCodes::API_EC_SESSION_REQUIRED);
}
return $this->_facebook->callGraphApi($gid . '/members');
}
} Horde_Service_Facebook-2.0.6/lib/Horde/Service/Facebook/Links.php 0000664 0001750 0001750 00000005054 12227214576 022662 0 ustar jan jan
* @category Horde
* @package Service_Facebook
*/
class Horde_Service_Facebook_Links extends Horde_Service_Facebook_Base
{
/**
* Retrieves links posted by the given user.
*
* @param integer $uid The user whose links you wish to retrieve
* @param array $options An options array:
* - limit: (integer) The maximum number of posts to return.
* - offset: (integer) The post to start returning from.
* - ids: (array) Only return these specfic links.
*
* @return array An array of links.
*/
public function get($uid = null, array $options = array())
{
// Require a session
if (!$this->_facebook->auth->getSessionKey()) {
throw new Horde_Service_Facebook_Exception(
'session_key is required',
Horde_Service_Facebook_ErrorCodes::API_EC_SESSION_REQUIRED);
}
if (empty($uid)) {
$uid = 'me';
}
if (!empty($options['ids'])) {
$options['ids'] = implode(',', $options['ids']);
return $this->_facebook->callGraphApi(
'',
$options);
}
return $this->_facebook->callGraphApi(
$uid . '/links',
$options);
}
/**
* Posts a link on Facebook.
*
* @param string $link URL/link you wish to post
* @param integer $uid User ID that is posting this link
* @param array $options Additional post options:
* - message: (string) A message to attach to the link.
* - picture (string) A URL to a thumbnail image to use for this post if
* link is set.
* - name: (string) A name for the post if link is set.
* - caption: (string) The caption, if link is set.
* - description: (string) A description, if link is specified.
*
* @return boolean
*/
public function post($link, $uid = null, array $options = array())
{
if (!$this->_facebook->auth->getSessionKey()) {
throw new Horde_Service_Facebook_Exception(
'session_key is required',
Horde_Service_Facebook_ErrorCodes::API_EC_SESSION_REQUIRED);
}
if (empty($uid)) {
$uid = 'me';
}
$options['link'] = $link;
return $this->_facebook->callGraphApi(
$uid . '/links',
$options,
array('request' => 'POST'));
}
} Horde_Service_Facebook-2.0.6/lib/Horde/Service/Facebook/Notes.php 0000664 0001750 0001750 00000005627 12227214576 022700 0 ustar jan jan
* @category Horde
* @package Service_Facebook
*/
class Horde_Service_Facebook_Notes extends Horde_Service_Facebook_Base
{
/**
* Creates a note with the specified title and content.
*
* @param string $title Title of the note.
* @param string $content Content of the note.
* @param integer $uid The user for whom you are creating a note;
* defaults to current session user
*
* @return integer The ID of the note that was just created.
*/
public function create($title, $content, $uid = 'me')
{
// Session key is *required*
if (!$this->_facebook->auth->getSessionKey()) {
throw new Horde_Service_Facebook_Exception(
'session_key is required',
Horde_Service_Facebook_ErrorCodes::API_EC_SESSION_REQUIRED);
}
return $this->_facebook->callGraphApi(
$uid . '/notes',
array('message' => $content, 'subject' => $title),
array('request' => 'POST'));
}
/**
* Deletes the specified note.
*
* @param integer $note_id ID of the note you wish to delete
*
* @return boolean
*/
public function delete($note_id)
{
// Session key is *required*
if (!$this->_facebook->auth->getSessionKey()) {
throw new Horde_Service_Facebook_Exception(
'session_key is required',
Horde_Service_Facebook_ErrorCodes::API_EC_SESSION_REQUIRED);
}
return $this->_facebook->callGraphApi(
$note_id,
array(),
array('request' => 'DELETE'));
}
/**
* Retrieves all notes by a user. If note_ids are specified,
* retrieves only those specific notes by that user.
*
* @param integer $uid User whose notes you wish to retrieve
* @param array $note_ids (Optional) List of specific note
* IDs by this user to retrieve
*
* @return array A list of all of the given user's notes, or an empty list
* if the viewer lacks permissions or if there are no visible
* notes.
*/
public function get($uid = 'me', $note_ids = null)
{
// Session key is *required*
if (!$this->_facebook->auth->getSessionKey()) {
throw new Horde_Service_Facebook_Exception(
'session_key is required',
Horde_Service_Facebook_ErrorCodes::API_EC_SESSION_REQUIRED);
}
if (empty($note_ids)) {
return $this->_facebook->callGraphApi($uid . '/notes');
}
return $this->_facebook->callMethod('', array('ids' => $note_ids));
}
} Horde_Service_Facebook-2.0.6/lib/Horde/Service/Facebook/Notifications.php 0000664 0001750 0001750 00000002126 12227214576 024410 0 ustar jan jan
* @category Horde
* @package Service_Facebook
*/
class Horde_Service_Facebook_Notifications extends Horde_Service_Facebook_Base
{
/**
* Returns the outstanding notifications for the session user.
*
* @return array An assoc array of notification count objects for
* 'messages', 'pokes' and 'shares', a uid list of
* 'friend_requests', a gid list of 'group_invites',
* and an eid list of 'event_invites'
* @throws Horde_Service_Facebook_Exception
*/
public function get()
{
// Session key is *required*
if (!$this->_facebook->auth->getSessionKey()) {
throw new Horde_Service_Facebook_Exception(
'session_key is required',
Horde_Service_Facebook_ErrorCodes::API_EC_SESSION_REQUIRED);
}
return $this->_facebook->callMethod('facebook.notifications.get');
}
} Horde_Service_Facebook-2.0.6/lib/Horde/Service/Facebook/Photos.php 0000664 0001750 0001750 00000020171 12227214576 023053 0 ustar jan jan
* @category Horde
* @package Service_Facebook
*/
class Horde_Service_Facebook_Photos extends Horde_Service_Facebook_Base
{
/**
* Adds a tag with the given information to a photo. See the wiki for details:
*
* http://wiki.developers.facebook.com/index.php/Photos.addTag
*
* @param string $pid The ID of the photo to be tagged
* @param array $options An options array:
* - to: (string) A UID of the user being tagged.
* - text: (string) Text to name the user if UID is not known/available.
* - x: (float) The horizontal position of the tag as a percentage from
* the left of the photo.
* - y: (float) The vertical position of the tag as a percentage from the
* top of the photo.
*
*
* @return boolean
*/
public function addTag($pid, array $options = array())
{
// Requires either a owner_uid or a session_key
if (!$this->_facebook->auth->getSessionKey()) {
throw new Horde_Service_Facebook_Exception(
'photos.addTag requires either a uid or a session_key',
Horde_Service_Facebook_ErrorCodes::API_EC_SESSION_REQUIRED);
}
return $this->_facebook->callGraphApi(
$pid,
$options,
array('request' => 'POST'));
return $results;
}
/**
* Creates and returns a new album owned by the specified user or the current
* session user.
*
* @param string $name The name of the album.
* @param string $description (Optional) A description of the album.
* @param string $uid (Optional) User id for creating the album; if
* not specified, the session user is used.
*
* @return array An album object
*/
public function createAlbum($name, $description = '', $uid = 'me')
{
// Requires either a owner_uid or a session_key
if (!$this->_facebook->auth->getSessionKey()) {
throw new Horde_Service_Facebook_Exception(
'photos.addTag requires either a owner_uid or a session_key',
Horde_Service_Facebook_ErrorCodes::API_EC_SESSION_REQUIRED);
}
return $this->_facebook->callGraphApi(
$uid . '/albums',
array('name' => $name, 'message' => $description),
array('request' => 'POST'));
}
/**
* Returns photos according to the filters specified.
*
* @param array $filter An options array containing a maximum of ONE of
* the following values:
* - tagged: Filter by photos tagged with this user.
* - album: Filter by photos in these albums.
* - photos: Only return indicated photos.
*
* @param array $options Additional options:
* - limit: (integer) The maximum number of posts to return.
* - offset: (integer) The post to start returning from.
*
* @return array An array of photo objects.
*/
public function get(array $filter = array(), array $options = array())
{
// Requires a session_key
if (!$this->_facebook->auth->getSessionKey()) {
throw new Horde_Service_Facebook_Exception(
'photos.addTag requires a session_key',
Horde_Service_Facebook_ErrorCodes::API_EC_SESSION_REQUIRED);
}
$params = array();
if (!empty($filter['tagged'])) {
$uid = $filter['tagged'] . '/photos';
} elseif (!empty($filter['album'])) {
$uid = $filter['album'];
} elseif (!empty($filter['photos'])) {
$uid = '';
$params = array('ids' => $filter['photos']);
} else {
$uid = 'me/photos';
}
$params = array_merge($options, $params);
return $this->_facebook->callGraphApi($uid, $params);
}
/**
* Returns the albums created by the given user.
*
* Note that at least one of the (uid, aids) parameters must be specified.
*
* @param integer $uid (Optional) The uid of the user whose albums you want.
* A null will return the albums of the session user.
* @param string $aids (Optional) A comma-separated list of aids to restricti
* the query.
*
* @return array of album objects.
*/
public function getAlbums($uid = 'me', $aids = null)
{
// Requires a session_key
if (!$this->_facebook->auth->getSessionKey()) {
throw new Horde_Service_Facebook_Exception(
'photos.addTag requires a session_key',
Horde_Service_Facebook_ErrorCodes::API_EC_SESSION_REQUIRED);
}
if (empty($aids)) {
$params = array();
$uid = $uid . '/albums';
} else {
$params = array('ids' => $aids);
$uid = '';
}
return $this->_facebook->callGraphApi($uid, $params);
}
/**
* Return the tags for a photo.
*
* @param string $pid The photo id
*
* @return array An array of photo tag objects, which include pid,
* subject uid, and two floating-point numbers (xcoord, ycoord)
* for tag pixel location.
*/
public function getTags($pid)
{
// Requires a session_key
if (!$this->_facebook->auth->getSessionKey()) {
throw new Horde_Service_Facebook_Exception(
'photos.addTag requires a session_key',
Horde_Service_Facebook_ErrorCodes::API_EC_SESSION_REQUIRED);
}
return $this->_facebook->graphApi($pid . '/tags');
}
/**
* Uploads a photo.
*
* @param array $params The parameter array.
* - file: (string) A local path to the file to upload.
* DEFAULT: None, but either 'file' or 'url' is required.
* - url: (string) A URL to an image to upload.
* DEFAULT: None, but either 'file' or 'url' is required.
* - aid: (string) The album id.
* DEFAULT: None (Will upload to the application's album).
* - caption: (string) The photo caption.
* DEFAULT: None.
* - place: (string) A Facebook UID of the place the photo was taken near.
* DEFAULT: None.
* - uid: (string) The Facebook UID of the user we are uploading on behalf
* of.
* DEFAULT: None (Will upload on behalf of the current user).
* @return array An array of user objects
*/
public function upload(array $params = array())
{
// Requires either a owner_uid or a session_key
if (!$this->_facebook->auth->getSessionKey()) {
throw new Horde_Service_Facebook_Exception(
'photos.addTag requires either a uid or a session_key',
Horde_Service_Facebook_ErrorCodes::API_EC_SESSION_REQUIRED);
}
// Defaults
$params = array_merge(
array(
'caption' => '',
'aid' => '',
'place' => ''
),
$params
);
// Build the data to send.
$data = array(
'message' => $params['caption'],
'place' => $params['place']
);
// Uploading to the application gallery or other?
if (!empty($params['aid'])) {
$uid = $params['aid'] . '/photos';
} else {
$uid = empty($params['uid']) ? 'me/photos' : $params['uid'] . '/photos';
}
// Uploading image or providing URL?
if (!empty($params['file'])) {
$request = new Horde_Service_Facebook_Request_Graph($this->_facebook, $uid);
return $request->upload(array('params' => $data, 'file' => $params['file']));
} elseif (!empty($params['url'])) {
$data['url'] = $params['url'];
}
return $this->_facebook->callGraphApi(
$uid,
$data,
array('request' => 'POST')
);
}
} Horde_Service_Facebook-2.0.6/lib/Horde/Service/Facebook/Streams.php 0000664 0001750 0001750 00000017223 12227214576 023221 0 ustar jan jan
* @category Horde
* @package Service_Facebook
*/
class Horde_Service_Facebook_Streams extends Horde_Service_Facebook_Base
{
/**
* Get a specific post.
*
* @param string The post UID.
*
* @return object The post object.
*/
public function getPost($uid)
{
return $this->_facebook->callGraphApi($uid);
}
/**
* Get a user's wall stream
*
* @param string $uid The user id.
*
* @return mixed Method call results.
*/
public function getWall($uid = '')
{
if (empty($uid) && !$this->_facebook->auth->getSessionKey()) {
throw new Horde_Service_Facebook_Exception(
'Streams.get requires either a uid or a session_key',
Horde_Service_Facebook_ErrorCodes::API_EC_PARAM_SESSION_KEY);
}
if (empty($uid)) {
$uid = 'me';
}
return $this->_facebook->callGraphApi($uid . '/feed');
}
/**
* Return the logged in user's news stream.
*
* @param string $filter A named stream filter to apply.
* @param array $options Additional options:
* - limit: (integer) The maximum number of posts to return.
* - offset: (integer) The post to start returning from.
* - until: (timestamp) Do not return posts after this timestamp.
* - since: (timestamp) Do not return posts before this timestamp.
*
* @return object
*/
public function getStream($filter = null, array $options = array())
{
if (!$session_key = $this->_facebook->auth->getSessionKey()) {
throw new Horde_Service_Facebook_Exception(
'Streams.get requires a session_key',
Horde_Service_Facebook_ErrorCodes::API_EC_PARAM_SESSION_KEY);
}
if (!empty($filter)) {
$options['filter'] = $filter;
}
return $this->_facebook->callGraphApi('me/home', $options);
}
/**
* Get a user's stream filter.
*
* @param integer $uid The user id of whose filters we are requesting.
*
* @return array of filter data.
*/
public function getFilters($uid)
{
if (empty($uid) || !$this->_facebook->auth->getSessionKey()) {
throw new Horde_Service_Facebook_Exception(
'Streams.getFilters requires a uid and a session_key',
Horde_Service_Facebook_ErrorCodes::API_EC_PARAM_SESSION_KEY);
}
$fql = 'SELECT filter_key, name FROM stream_filter WHERE uid="'
. $uid . '"';
return $this->_facebook->fql->run($fql);
}
/**
* Post a message to a user's stream.
*
* @param string $uid The user id of the user whose stream we are
* posting the message to.
* @param string $message The message body to post.
* @param array $options Additional post options:
* - link: (string) A link to attach to this post.
* - picture (string) A URL to a thumbnail image to use for this post if
* link is set.
* - name: (string) A name for the post if link is set.
* - caption: (string) The caption, if link is set.
* - description: (string) A description, if link is specified.
* - actions: (array) An array of actions containing name and link (?).
* - place: (string) Facebook page id of the location associated with post.
* - tags: (string) Comma delimted list of Facebook ids of people tagged
* in this post. Requires place tags to be passed also.
* - privacy: (string) Privacy settings (if posting to the current user's
* stream only). This is a JSON encoded object that defines
* the privacy settings.
* See https://developers.facebook.com/docs/reference/api/user/#posts
* -object_attachment: (string) The Facebook id for an existing picture
* in the user's photo albums to use as the thumbnail
* image. User must be the owner of the photo.
*
* @return string The UID of the new post.
*/
public function post($uid, $message, array $options = array())
{
$options['message'] = $message;
$results = $this->_facebook->callGraphApi(
$uid . '/feed',
$options,
array('request' => 'POST'));
return $results->id;
}
/**
* Remove a post from a user's stream
*
* @param string $postId The post id
*
* @return boolean
*/
public function delete($postid)
{
if (!$this->_facebook->auth->getSessionKey()) {
throw new Horde_Service_Facebook_Exception(
'Streams.remove requires either a uid or a session_key',
Horde_Service_Facebook_ErrorCodes::API_EC_PARAM_SESSION_KEY);
}
return $this->_facebook->callGraphApi(
$postid,
array(),
array('request' => 'DELETE'));
}
/**
* Add a comment to a user's post.
*
* @param string $postId The post id the comment belongs to
* @param string $comment The body of the comment (text only, no HTML).
*
* @return string The comment id of the posted comment.
*/
public function addComment($postId, $comment)
{
if (!$this->_facebook->auth->getSessionKey()) {
throw new Horde_Service_Facebook_Exception(
'Streams.addComment requires either a uid or a session_key',
Horde_Service_Facebook_ErrorCodes::API_EC_PARAM_SESSION_KEY);
}
return $this->_facebook->callGraphApi(
$postId . '/comments',
array('message' => $comment),
array('request' => 'POST'));
}
/**
* Remove a comment from a post.
*
* @param string $commentId The comment id to remove.
*
* @return boolean
*/
public function removeComment($commentId)
{
if (!$this->_facebook->auth->getSessionKey()) {
throw new Horde_Service_Facebook_Exception(
'Streams.removeComment requires either a uid or a session_key',
Horde_Service_Facebook_ErrorCodes::API_EC_PARAM_SESSION_KEY);
}
return $this->_facebook->callGraphApi(
$commentId,
array(),
array('request' => 'DELETE'));
}
/**
* Add a "like" to a post.
*
* @param string $postId
*
* @return boolean
*/
public function addLike($postId)
{
if (!$this->_facebook->auth->getSessionKey()) {
throw new Horde_Service_Facebook_Exception(
'Streams.addLike requires either a uid or a session_key',
Horde_Service_Facebook_ErrorCodes::API_EC_PARAM_SESSION_KEY);
}
return $this->_facebook->callGraphApi(
$postId . '/likes',
array(),
array('request' => 'POST'));
}
/**
* Remove a "like" from a stream post.
*
* @param string $postId The post id to remove a like from.
*
* @return boolean
*/
public function removeLike($postId)
{
if (!$this->_facebook->auth->getSessionKey()) {
throw new Horde_Service_Facebook_Exception(
'Streams.removeLike requires either a uid or a session_key',
Horde_Service_Facebook_ErrorCodes::API_EC_PARAM_SESSION_KEY);
}
return $this->_facebook->callGraphApi(
$postId . '/likes',
array(),
array('request' => 'DELETE'));
}
} Horde_Service_Facebook-2.0.6/lib/Horde/Service/Facebook/Translation.php 0000664 0001750 0001750 00000003366 12227214576 024104 0 ustar jan jan
* @package Service_Facebook
*/
class Horde_Service_Facebook_Translation extends Horde_Translation
{
/**
* Returns the translation of a message.
*
* @var string $message The string to translate.
*
* @return string The string translation, or the original string if no
* translation exists.
*/
static public function t($message)
{
self::$_domain = 'Horde_Service_Facebook';
self::$_directory = '@data_dir@' == '@'.'data_dir'.'@' ? __DIR__ . '/../../../../locale' : '@data_dir@/Horde_Service_Facebook/locale';
return parent::t($message);
}
/**
* Returns the plural translation of a message.
*
* @param string $singular The singular version to translate.
* @param string $plural The plural version to translate.
* @param integer $number The number that determines singular vs. plural.
*
* @return string The string translation, or the original string if no
* translation exists.
*/
static public function ngettext($singular, $plural, $number)
{
self::$_domain = 'Horde_Service_Facebook';
self::$_directory = '@data_dir@' == '@'.'data_dir'.'@' ? __DIR__ . '/../../../../locale' : '@data_dir@/Horde_Service_Facebook/locale';
return parent::ngettext($singular, $plural, $number);
}
}
Horde_Service_Facebook-2.0.6/lib/Horde/Service/Facebook/Users.php 0000664 0001750 0001750 00000006313 12227214576 022702 0 ustar jan jan
* @category Horde
* @package Service_Facebook
*/
class Horde_Service_Facebook_Users extends Horde_Service_Facebook_Base
{
/**
* Local cache of requested permissions
*
* @var array
*/
protected $_permissions = array();
/**
* Local cache of requested user information
*
* @var array
*/
protected $_users = array();
/**
* Return a URL to the facebook page of the requested user.
*
* @param string $uid The Facebook user id.
*
* @return string The URL to the user's Facebook page.
*/
public function getProfileLink($uid)
{
return $this->_facebook->getFacebookUrl() . '/' . $uid;
}
/**
* Return a URL to the user's thumbnail image.
*
* @param string $uid The Facebook user id.
*
* @return string The URL to the user's Facebook thumbnail.
*/
public function getThumbnail($uid)
{
return $this->_facebook->getFacebookUrl('graph') . '/' . $uid . '/picture';
}
/**
* Returns the requested info fields for the requested set of users.
*
* @param string $uids A comma-separated list of user ids
* @param array $fields An array of fields to return. If empty, all fields
* are returned.
*
* @todo Better cache handling.
*
* @return object The user information as a stdClass.
*/
public function getInfo($uid = null, array $fields = array())
{
if (empty($uid)) {
$uid = 'me';
}
if (!empty($fields)) {
$params = array('fields' => implode(',', $fields));
} else {
$params = array();
}
$key = md5($uid . implode(',', $fields));
if (empty($this->_users[$key])) {
$this->_users[$key] = $this->_facebook->callGraphApi($uid, $params);
}
return $this->_users[$key];
}
/**
* Return the list of the current application permissions for the specified
* user.
*
* @param string $uid The uid to request permissions for. If null, the
* currently authenticated user is used.
*
* @return array An array of permissions where the keys are permission
* names and the values are '1' for yes or '0' for no.
*/
public function getAppPermissions($uid = null)
{
if (empty($uid) && !$this->_facebook->auth->getSessionKey()) {
throw new Horde_Service_Facebook_Exception('users.hasAppPermission requires either a uid or a session_key',
Horde_Service_Facebook_ErrorCodes::API_EC_PARAM_SESSION_KEY);
}
if (empty($uid)) {
$uid = 'me';
}
if (empty($this->_permissions[$uid])) {
$results = $this->_facebook->callGraphApi($uid . '/permissions');
if (!empty($results) && !empty($results->data)) {
return $this->_permissions[$uid] = (array)$results->data[0];
}
} else {
return $this->_permissions[$uid];
}
}
} Horde_Service_Facebook-2.0.6/lib/Horde/Service/Facebook/Videos.php 0000664 0001750 0001750 00000003247 12227214576 023035 0 ustar jan jan
* @category Horde
* @package Service_Facebook
*/
class Horde_Service_Facebook_Videos extends Horde_Service_Facebook_Base
{
/**
* Uploads a video.
*
* @param array $params The parameter array.
* - file: (string) A local path to the file to upload.
* DEFAULT: none REQUIRED
* - caption: (string) The photo caption.
* DEFAULT: None.
* - uid: (string) The Facebook UID of where to post the video to. Normally
* a user id.
* DEFAULT: None (Will upload on behalf of the current user).
* @return array An array of user objects
*/
public function upload(array $params = array())
{
// Requires either a owner_uid or a session_key
if (!$this->_facebook->auth->getSessionKey()) {
throw new Horde_Service_Facebook_Exception(
'photos.addTag requires either a uid or a session_key',
Horde_Service_Facebook_ErrorCodes::API_EC_SESSION_REQUIRED);
}
if (empty($params['file'])) {
throw new InvalidArgumentException('Missing required file parameter.');
}
// Build the data to send.
$data = array(
'message' => empty($params['caption']) ? '' : $params['caption']
);
$uid = empty($params['uid']) ? 'me/videos' : $params['uid'] . '/videos';
$request = new Horde_Service_Facebook_Request_Graph($this->_facebook, $uid);
return $request->upload(array('params' => $data, 'file' => $params['file']));
}
} Horde_Service_Facebook-2.0.6/lib/Horde/Service/Facebook.php 0000664 0001750 0001750 00000014413 12227214576 021601 0 ustar jan jan
* @category Horde
* @package Service_Facebook
*/
/**
* Facebook Platform PHP5 client
*
* Copyright 2004-2009 Facebook. All Rights Reserved.
*
* Copyright (c) 2007 Facebook, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* For help with this library, contact developers-help@facebook.com
*/
class Horde_Service_Facebook
{
/**
* Use only ssl resource flag
*
* @var boolean
*/
public $useSslResources = false;
/**
* The API Secret Key
*
* @var string
*/
protected $_secret;
/**
* Holds an optional logger object
*
* @var Horde_Log_Logger
*/
protected $_logger;
/**
*
* @var Horde_Http_Client
*/
protected $_http;
/**
* Cache for the various objects we lazy load in __get()
*
* @var hash of Horde_Service_Facebook_* objects
*/
protected $_objCache = array();
const API_VALIDATION_ERROR = 1;
const REST_SERVER_ADDR = 'https://api.facebook.com/method/';
const GRAPH_SERVER_ADDR = 'https://graph.facebook.com';
/**
* Const'r
*
* @param string $appId Application ID.
* @param string $secret Developer API secret.
* @param array $context Array of context information containing:
*
* http_client - required * logger * use_ssl **/ public function __construct($appId, $secret, $context) { // We require a http client object. if (empty($context['http_client'])) { throw new InvalidArgumentException('A http client object is required'); } else { $this->_http = $context['http_client']; } // Optional Horde_Log_Logger if (!empty($context['logger'])) { $this->_logger = $context['logger']; } else { $this->_logger = new Horde_Support_Stub(); } $this->_logger->debug('Initializing Horde_Service_Facebook'); $this->_appId = $appId; $this->secret = $secret; if (!empty($context['use_ssl'])) { $this->useSslResources = true; } } /** * Lazy load the facebook classes. * * @param string $value The lowercase representation of the subclass. * * @return mixed * @throws Horde_Service_Facebook_Exception */ public function __get($value) { // First, see if it's an allowed protected value. switch ($value) { case 'appId': return $this->_appId; case 'secret': return $this->_secret; case 'http': return $this->_http; case 'logger': return $this->_logger; } // If not, assume it's a method/action class... $class = 'Horde_Service_Facebook_' . ucfirst($value); if (!class_exists($class)) { throw new Horde_Service_Facebook_Exception(sprintf("%s class not found", $class)); } if (empty($this->_objCache[$class])) { $this->_objCache[$class] = new $class($this); } return $this->_objCache[$class]; } /** * Helper function to get the appropriate facebook url * * @param string $subdomain The subdomain to use (www). * * @return string */ public static function getFacebookUrl($subdomain = 'www') { return 'https://' . $subdomain . '.facebook.com'; } /** * Calls the specified normal REST API method. * * @param string $method Name of the Facebook method to invoke * @param array $params A map of param names => param values * * @return mixed Result of method call */ public function callMethod($method, array $params = array()) { $this->_logger->debug(sprintf('Calling method %s with parameters %s', $method, print_r($params, true))); $request = new Horde_Service_Facebook_Request_Rest($this, $method, $params); return $request->run(); } /** * Call the Facebook Graph API. * * @param string $method The endpoint (method) to call. * @param array $params An array of parameters to pass along with the call. * @param array $options Additional request options: * - request: (string) 'POST', 'GET', 'DELETE' etc.. * * @return mixed The results of the API call. */ public function callGraphApi( $method = '', array $params = array(), array $options = array()) { $request = new Horde_Service_Facebook_Request_Graph( $this, $method, $params, $options); return $request->run(); } } Horde_Service_Facebook-2.0.6/locale/ar/LC_MESSAGES/Horde_Service_Facebook.mo 0000664 0001750 0001750 00000000607 12227214576 024445 0 ustar jan jan $ , 8 M 9 Project-Id-Version: Horde_Service_Facebook Report-Msgid-Bugs-To: dev@lists.horde.org POT-Creation-Date: 2010-10-13 01:27+0200 PO-Revision-Date: 2010-10-13 01:27+0200 Last-Translator: Automatically generated Language-Team: i18n@lists.horde.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Horde_Service_Facebook-2.0.6/locale/ar/LC_MESSAGES/Horde_Service_Facebook.po 0000664 0001750 0001750 00000001560 12227214576 024447 0 ustar jan jan # Arabic translations for Horde_Service_Facebook module. # Copyright 2010-2013 Horde LLC (http://www.horde.org/) # This file is distributed under the same license as the Horde_Service_Facebook module. # Automatically generated, 2010. # msgid "" msgstr "" "Project-Id-Version: Horde_Service_Facebook\n" "Report-Msgid-Bugs-To: dev@lists.horde.org\n" "POT-Creation-Date: 2010-10-13 01:27+0200\n" "PO-Revision-Date: 2010-10-13 01:27+0200\n" "Last-Translator: Automatically generated\n" "Language-Team: i18n@lists.horde.org\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #: lib/Horde/Service/Facebook/Request.php:94 msgid "Service is unavailable. Please try again later." msgstr "" #: lib/Horde/Service/Facebook/UploadRequest.php:94 #, fuzzy, php-format msgid "Upload failed: %s" msgstr "الحقول المستوردة: %s" Horde_Service_Facebook-2.0.6/locale/bg/LC_MESSAGES/Horde_Service_Facebook.mo 0000664 0001750 0001750 00000000607 12227214576 024433 0 ustar jan jan $ , 8 M 9 Project-Id-Version: Horde_Service_Facebook Report-Msgid-Bugs-To: dev@lists.horde.org POT-Creation-Date: 2010-10-13 01:27+0200 PO-Revision-Date: 2010-10-13 01:27+0200 Last-Translator: Automatically generated Language-Team: i18n@lists.horde.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Horde_Service_Facebook-2.0.6/locale/bg/LC_MESSAGES/Horde_Service_Facebook.po 0000664 0001750 0001750 00000001563 12227214576 024440 0 ustar jan jan # Bulgarian translations for Horde_Service_Facebook module. # Copyright 2010-2013 Horde LLC (http://www.horde.org/) # This file is distributed under the same license as the Horde_Service_Facebook module. # Automatically generated, 2010. # msgid "" msgstr "" "Project-Id-Version: Horde_Service_Facebook\n" "Report-Msgid-Bugs-To: dev@lists.horde.org\n" "POT-Creation-Date: 2010-10-13 01:27+0200\n" "PO-Revision-Date: 2010-10-13 01:27+0200\n" "Last-Translator: Automatically generated\n" "Language-Team: i18n@lists.horde.org\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #: lib/Horde/Service/Facebook/Request.php:94 msgid "Service is unavailable. Please try again later." msgstr "" #: lib/Horde/Service/Facebook/UploadRequest.php:94 #, fuzzy, php-format msgid "Upload failed: %s" msgstr "Импортирано поле: %s" Horde_Service_Facebook-2.0.6/locale/bs/LC_MESSAGES/Horde_Service_Facebook.mo 0000664 0001750 0001750 00000000607 12227214576 024447 0 ustar jan jan $ , 8 M 9 Project-Id-Version: Horde_Service_Facebook Report-Msgid-Bugs-To: dev@lists.horde.org POT-Creation-Date: 2010-10-13 01:27+0200 PO-Revision-Date: 2010-10-13 01:27+0200 Last-Translator: Automatically generated Language-Team: i18n@lists.horde.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Horde_Service_Facebook-2.0.6/locale/bs/LC_MESSAGES/Horde_Service_Facebook.po 0000664 0001750 0001750 00000001602 12227214576 024446 0 ustar jan jan # Bosnian translations for Horde_Service_Facebook module. # Copyright 2010-2013 Horde LLC (http://www.horde.org/) # This file is distributed under the same license as the Horde_Service_Facebook module. # Automatically generated, 2010. # msgid "" msgstr "" "Project-Id-Version: Horde_Service_Facebook\n" "Report-Msgid-Bugs-To: dev@lists.horde.org\n" "POT-Creation-Date: 2010-10-13 01:27+0200\n" "PO-Revision-Date: 2010-10-13 01:27+0200\n" "Last-Translator: Automatically generated\n" "Language-Team: i18n@lists.horde.org\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #: lib/Horde/Service/Facebook/Request.php:94 #, fuzzy msgid "Service is unavailable. Please try again later." msgstr "Desila se greška tokom prikaza ovog dijela poruke" #: lib/Horde/Service/Facebook/UploadRequest.php:94 #, php-format msgid "Upload failed: %s" msgstr "" Horde_Service_Facebook-2.0.6/locale/ca/LC_MESSAGES/Horde_Service_Facebook.mo 0000664 0001750 0001750 00000000607 12227214576 024426 0 ustar jan jan $ , 8 M 9 Project-Id-Version: Horde_Service_Facebook Report-Msgid-Bugs-To: dev@lists.horde.org POT-Creation-Date: 2010-10-13 01:27+0200 PO-Revision-Date: 2010-10-13 01:27+0200 Last-Translator: Automatically generated Language-Team: i18n@lists.horde.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Horde_Service_Facebook-2.0.6/locale/ca/LC_MESSAGES/Horde_Service_Facebook.po 0000664 0001750 0001750 00000001724 12227214576 024432 0 ustar jan jan # Catalan translations for Horde_Service_Facebook module. # Copyright 2010-2013 Horde LLC (http://www.horde.org/) # This file is distributed under the same license as the Horde_Service_Facebook module. # Automatically generated, 2010. # msgid "" msgstr "" "Project-Id-Version: Horde_Service_Facebook\n" "Report-Msgid-Bugs-To: dev@lists.horde.org\n" "POT-Creation-Date: 2010-10-13 01:27+0200\n" "PO-Revision-Date: 2010-10-13 01:27+0200\n" "Last-Translator: Automatically generated\n" "Language-Team: i18n@lists.horde.org\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #: lib/Horde/Service/Facebook/Request.php:94 #, fuzzy msgid "Service is unavailable. Please try again later." msgstr "" "S'ha produït un error en actualitzar els detalls de contacte. Torneu-ho a " "intentar més tard." #: lib/Horde/Service/Facebook/UploadRequest.php:94 #, fuzzy, php-format msgid "Upload failed: %s" msgstr "És impossible copiar: %s" Horde_Service_Facebook-2.0.6/locale/cs/LC_MESSAGES/Horde_Service_Facebook.mo 0000664 0001750 0001750 00000000715 12227214576 024450 0 ustar jan jan $ , 8 9 Project-Id-Version: Horde_Service_Facebook Report-Msgid-Bugs-To: dev@lists.horde.org POT-Creation-Date: 2010-10-13 01:27+0200 PO-Revision-Date: 2010-10-13 01:27+0200 Last-Translator: Automatically generated Language-Team: i18n@lists.horde.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2; Horde_Service_Facebook-2.0.6/locale/cs/LC_MESSAGES/Horde_Service_Facebook.po 0000664 0001750 0001750 00000001774 12227214576 024461 0 ustar jan jan # Czech translations for Horde_Service_Facebook module. # Copyright 2010-2013 Horde LLC (http://www.horde.org/) # This file is distributed under the same license as the Horde_Service_Facebook module. # Automatically generated, 2010. # msgid "" msgstr "" "Project-Id-Version: Horde_Service_Facebook\n" "Report-Msgid-Bugs-To: dev@lists.horde.org\n" "POT-Creation-Date: 2010-10-13 01:27+0200\n" "PO-Revision-Date: 2010-10-13 01:27+0200\n" "Last-Translator: Automatically generated\n" "Language-Team: i18n@lists.horde.org\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n" #: lib/Horde/Service/Facebook/Request.php:94 #, fuzzy msgid "Service is unavailable. Please try again later." msgstr "Nastala chyba při aktualizaci kontaktu. Prosím zkuste to později." #: lib/Horde/Service/Facebook/UploadRequest.php:94 #, fuzzy, php-format msgid "Upload failed: %s" msgstr "Kopírování selhalo: %s" Horde_Service_Facebook-2.0.6/locale/da/LC_MESSAGES/Horde_Service_Facebook.mo 0000664 0001750 0001750 00000000662 12227214576 024430 0 ustar jan jan $ , 8 x 9 Project-Id-Version: Horde_Service_Facebook Report-Msgid-Bugs-To: dev@lists.horde.org POT-Creation-Date: 2010-10-13 01:27+0200 PO-Revision-Date: 2010-10-13 01:27+0200 Last-Translator: Automatically generated Language-Team: i18n@lists.horde.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=(n != 1); Horde_Service_Facebook-2.0.6/locale/da/LC_MESSAGES/Horde_Service_Facebook.po 0000664 0001750 0001750 00000001744 12227214576 024435 0 ustar jan jan # Danish translations for Horde_Service_Facebook module. # Copyright 2010-2013 Horde LLC (http://www.horde.org/) # This file is distributed under the same license as the Horde_Service_Facebook module. # Automatically generated, 2010. # msgid "" msgstr "" "Project-Id-Version: Horde_Service_Facebook\n" "Report-Msgid-Bugs-To: dev@lists.horde.org\n" "POT-Creation-Date: 2010-10-13 01:27+0200\n" "PO-Revision-Date: 2010-10-13 01:27+0200\n" "Last-Translator: Automatically generated\n" "Language-Team: i18n@lists.horde.org\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: lib/Horde/Service/Facebook/Request.php:94 #, fuzzy msgid "Service is unavailable. Please try again later." msgstr "Der opstod en fejl under opdatering af kontakt-detaljerne. Prøv igen." #: lib/Horde/Service/Facebook/UploadRequest.php:94 #, fuzzy, php-format msgid "Upload failed: %s" msgstr "Kopiering mislykkedes: %s" Horde_Service_Facebook-2.0.6/locale/de/LC_MESSAGES/Horde_Service_Facebook.mo 0000664 0001750 0001750 00000001263 12227214576 024432 0 ustar jan jan 4 L ` 8 a _ 6 Facebook service is unavailable. Please try again later. Upload failed: %s Project-Id-Version: Horde_Service_Facebook Report-Msgid-Bugs-To: dev@lists.horde.org POT-Creation-Date: 2012-07-19 18:34+0200 PO-Revision-Date: 2011-08-02 15:37+0200 Last-Translator: Jan Schneider