Provides API wrappers for the Facebook Graph API
Summary↑
| fanCount(page_id, access_token) | Get the count of fans for the provided page_id |
| init() | Callback implementation of |
| me(fields, access_token) | Basic user infos of the logged in user (specified by the access_token) |
| myLikes(access_token) | Likes of the currently logged in user (specified by the access_token) |
| objectCount(atom1, object_id, access_token) | Gets the total number of people who commented an object. An object stands for: post, comment, link, status update, photo |
| page(page_id, access_token) | Basic page information for the provided page_id |
| page(page_id, access_token, fields) | Get page information for the specified fields for the provided page_id |
| pageFeed(page_id, access_token) | Feed of posts for the provided page_id. The maximum posts returned is 25, which is the facebook’s default |
| pageFeed(page_id, access_token, limit) | Get the feed of posts (including status updates) and links published by others or the page specified in page_id |
| pageLikes(page_id, access_token) | Deprecated: Please use fanCount instead |
| permissions(user_id, access_token) | Retrieves a list of granted permissions |
| picture(user_id, type, access_token) | A Picture for a Facebook User |
| setAppsecret(appsecret) | If you want to use an appsecret proof, pass it into set_appsecret: |
| start(type, args) | Start hook |
| start_link() | Supervisor start |
Types ↑
fields :: list
response :: {:json, HashDict.t} | {:body, String.t}
using_appsecret :: boolean
Functions
Specs:
- fanCount(page_id :: integer | String.t, access_token) :: integer
Get the count of fans for the provided page_id
Example
iex> Facebook.fanCount("CocaColaMx", "<Your Token>")
See: https://developers.facebook.com/docs/graph-api/reference/page/
Callback implementation of :supervisor.init/1.
Specs:
- me(fields, access_token) :: response
- me(fields :: String.t, access_token) :: response
Basic user infos of the logged in user (specified by the access_token).
Example
iex> Facebook.me([fields: "id,first_name"], "<Your Token>")
See: https://developers.facebook.com/docs/graph-api/reference/user/
Specs:
- myLikes(access_token) :: response
Likes of the currently logged in user (specified by the access_token)
Example
iex> Facebook.myLikes("<Your Token>")
See: https://developers.facebook.com/docs/graph-api/reference/user/likes
Gets the total number of people who commented an object. An object stands for: post, comment, link, status update, photo.
Example
iex> Facebook.objectCount(:comments, "1326382730725053_1326476257382367", "<Token>")
2
See: https://developers.facebook.com/docs/graph-api/reference/object/comments
Specs:
- page(page_id :: integer | String.t, access_token) :: response
Basic page information for the provided page_id
Example
iex> Facebook.page("CocaColaMx", "<Your Token>")
See: https://developers.facebook.com/docs/graph-api/reference/page
Specs:
- page(page_id :: integer | String.t, access_token, fields) :: response
Get page information for the specified fields for the provided page_id
Example
iex> Facebook.page("CocaColaMx", "<Your Token>", "id")
See: https://developers.facebook.com/docs/graph-api/reference/page
Feed of posts for the provided page_id. The maximum posts returned is 25, which is the facebook’s default.
Example
iex> Facebook.pageFeed("CocaColaMx", "<Your Token>")
See: https://developers.facebook.com/docs/graph-api/reference/page/feed
Get the feed of posts (including status updates) and links published by others or the page specified in page_id.
A limit of posts may be given. The maximim number that must be provided, is 100.
Example
iex> Facebook.pageFeed("CocaColaMx", "<Your Token>", 55)
See: https://developers.facebook.com/docs/graph-api/reference/page/feed
Deprecated: Please use fanCount instead.
Get the count of fans for the provided page_id
Example
iex> Facebook.pageLikes("CocaColaMx", "<Your Token>")
See: https://developers.facebook.com/docs/graph-api/reference/page/
Specs:
- permissions(user_id :: integer | String.t, access_token) :: response
Retrieves a list of granted permissions
Example
iex> Facebook.permissions("<Some Id>", "<Your Token>")
See: https://developers.facebook.com/docs/graph-api/reference/user/permissions
Specs:
- picture(user_id :: String.t, type :: String.t, access_token) :: response
A Picture for a Facebook User
Example
iex> Facebook.picture("<Some Id>", "small", "<Your Token>")
See: https://developers.facebook.com/docs/graph-api/reference/user/picture/
If you want to use an appsecret proof, pass it into set_appsecret:
Example
iex> Facebook.setAppsecret("appsecret")
See: https://developers.facebook.com/docs/graph-api/securing-requests
Start hook
Supervisor start