Monday, December 20, 2010

Login to social networks

Connect with Facebook

Share data to social networks

Facebook:
Share on Facebook

Myspace:

Share on Myspace

Sunday, December 19, 2010

public OAuth services

Twitter:

- Access url="http://api.twitter.com/oauth/access_token" method="POST"
- Request url="http://api.twitter.com/oauth/request_token" method="POST"
- Authorization url="http://api.twitter.com/oauth/authorize"

Facebook:
- Request url="https://gateway.jivesoftware.com/oauth2" method="GET"
- Access url="https://graph.facebook.com/oauth/access_token" method="GET"
- Authorization url="https://graph.facebook.com/oauth/authorize?scope=read_stream,offline_access"

Google, Orkut:
- Access url="https://www.google.com/accounts/OAuthGetAccessToken"
- Request url="https://www.google.com/accounts/OAuthGetRequestToken"
- Authorization url="https://www.google.com/accounts/OAuthAuthorizeToken"

Yahoo:
- Access url="https://api.login.yahoo.com/oauth/v2/get_token"
- Request url="https://api.login.yahoo.com/oauth/v2/get_request_token"
- Authorization url="https://api.login.yahoo.com/oauth/v2/request_auth"

Hi5:
- Access url="https://api.hi5.com/oauth/accessToken"
- Request url="https://api.hi5.com/oauth/requestToken"
- Authorization url="https://login.hi5.com/oauth/authorize"

Myspace:
- Access url="http://api.myspace.com/access_token"
- Request url="http://api.myspace.com/request_token"
- Authorization url="http://api.myspace.com/authorize"

Facebook old REST APIs

These API will be deprecated in future, they are replaced by Graph API
Template:
https://api.facebook.com/method/method_name?
access_token=oauth_access_token&
arg0=value0&
arg1=value1
Example:
https://api.facebook.com/method/friends.get?
access_token=2227470867|2.m0hi0FTGb8nIedjDvglJxA__.3600.1292821200-1254980440|k547Mmt0G-Iu80j8AnC2HCZ_H68

Facebook Graph APIs example

Graph API template:
https://graph.facebook.com/ID/Application_ID?access_token=...

Examples:
Run url on browser: https://graph.facebook.com/kiennguyenanh
You will receiver the result:
{
"id": "1254980440",
"name": "Kien Nguyen",
"first_name": "Kien",
"last_name": "Nguyen",
"link": "http://www.facebook.com/kiennguyenanh",
"gender": "male",
"locale": "en_US"
}

https://graph.facebook.com/me/albums?access_token=2227470867|2.m0hi0FTGb8nIedjDvglJxA__.3600.1292821200-1254980440|k547Mmt0G-Iu80j8AnC2HCZ_H68 (maybe token will be expired)

- friends, home, feed, likes, books, movies, notes, ...

Tuesday, December 14, 2010

REST Url via Webdav of eXo Portal and GateIn

eXo portal 2.5.x:
http://localhost:8080/rest/private/jcr/repository/system/exo:registry/exo:applications/

GateIn:
http://localhost:8080/rest/private/jcr/repository/system/jcr:system/

Monday, December 13, 2010

Important notes for setting up environment: Apache2+php+mysql

MS Windows:
- Install Apache2
- Install PHP
- Configure loading module php from Apache2, open apache2.conf from conf folder of Apache2
# php5apache2.dll for Apache2, php5apache2_2.dll for Apache2_2
LoadModule php5_module "c:/php/php5apache2_2.dll"
AddHandler application/x-httpd-php .php

# configure the path to php.ini
PHPIniDir "C:/php"

We also have alternative solution for this by installing lamp server: sudo apt-get install lamp-server.