namest / facebook
v0.1
2015-03-17 03:20 UTC
Requires
- everyman/neo4jphp: dev-master
- facebook/php-sdk-v4: ~4.0
- guzzlehttp/guzzle: ~5.2
- illuminate/console: ~5.0
- illuminate/database: ~5.0
- illuminate/http: ~5.0
- illuminate/log: ~5.0
- illuminate/support: ~5.0
Requires (Dev)
- mockery/mockery: ~0.9
- phpunit/phpunit: ~4.5
This package is not auto-updated.
Last update: 2024-11-23 18:30:45 UTC
README
#API (Prototype)
Objects
$user = new User(<facebook_id>); $user->sync(); // Sync all user informations $user->fetch(); // Get user information from facebook but not sync $user->get(); // Get user information from local database $user = User::find(<facebook_id>); $user = User::findOrSync(<facebook_id>); $user = User::findOrFetch(<facebook_id>);
Edges
$pages = $user->accounts; // Get all user's pages from local database $user->accounts()->sync(); // Sync user's pages from facebook $page = $pages[0]; // Return Page instance $page->sync(); // All object api is the same $page->posts; // Get all page's posts from local database $page->posts()->sync(); // Sync page's posts from facebook
Action
// Comment $user->leave($message)->on($post); // Leave comment $user->leave($message)->on($comment); // Leave comment // Like & Unline $user->like($comment); $user->like($post); $user->unlike($comment); // Hide & Unhide $user->hide($comment); $user->unhide($comment); // Delete $user->delete($comment); $user->delete($post); // Publish $user->publish($message)->on($page); // Publish Post // Schedule $user->schedule($post, $published_at);
Advanced Query
$post->page; // Get page of post
Supported Edges
$user->accounts
$post->likes $post->comments
$comment->likes $comment->comments
Graph
(user:User)-[r:MANAGE]->(page:Page)
r.access_token
(user:User)-[:LEAVE]->(comment:Comment)-[:ON]->(post:Post)
(user:User)-[:LEAVE]->(comment:Comment)-[:ON]->(comment:Comment)
(page:Page)-[:LEAVE]->(comment:Comment)-[:ON]->(post:Post)
(page:Page)-[:LEAVE]->(comment:Comment)-[:ON]->(comment:Comment)
(user:User)-[r:LIKE]->(post:Post)
r.created_time
(user:User)-[r:LIKE]->(comment:Comment)
r.created_time
(page:Page)-[r:LIKE]->(post:Post)
r.created_time
(page:Page)-[r:LIKE]->(comment:Comment)
r.created_time
(user:User)-[:PUBLISH]->(post:Post)-[:ON]->(page:Page)
(app:Application)-[:PUBLISH]->(post:Post)-[:ON]->(page:Page)