Coder Social home page Coder Social logo

facebook.ex's Issues

Looking for a new maintainer

I'm not using this library since a while now and that's also the reason why there's not much activity going on.
I'd be glad if someone could take over maintenance which uses the library.

Maybe @bugant?

module :hmac is not available

Error, when using Facebook.me()

** (UndefinedFunctionError) undefined function :hmac.hexlify/2 (module :hmac is not available)

To get around this I needed to specify the github repo in mix.exs

Batch support

I would like to add support for batch requests. I think this will necessitate some design changes. In particular, I think it means many of the API methods should return a request instead of a response, and then adding a new function that sends one or a batch of requests together and returns a response.

Here's how it might(?) look:

pages = Repo.all(Page)
  |> Enum.map(fn page -> Facebook.page(page.facebook_page_id) end)
  |> Facebook.requestBatch()

Configuration sample

Hello I followed the example in the readme but I got this error.

** (ArgumentError) application :facebook is not loaded, or the configuration parameter :appsecret is not set
    (elixir) lib/application.ex:281: Application.fetch_env!/2
    lib/facebook.ex:488: Facebook.add_app_secret/2
    lib/facebook.ex:73: Facebook.me/2

Please can you provide a sample mix configuration.

PROPOSAL - Add extendable usage

Hello, Facebook API is huge and you can't cover all things in your lib. So I think it would be nice to make it extendable. Like this:
project_name/lib/project_name/api_wrappers/facebook.ex

defmodule ProjectName.ApiWrappers.FacebookApi do
  use Facebook # your lib

  def my_custom_api_call(args) do
    HTTPoison.get ...
  end
end

As a result, we can use your lib API along with our custom.

HTTPPosion version bump

Any plans to start using httppoison at leat to 1.0? 0.13 is a bit old and brings inconsistency to project.

Versioned graph url doesn't work with exchanging long lived access token

I want to pin the API version my app will be using. To do so, I set the graph_url with Facebook's versioning scheme to a specific version, like this one: https://graph.facebook.com/v2.11/.
This, however, breaks the long_lived_access_token call as the uri used therein (/oauth/access_token) isn't available in versioned paths, only at root.
Maybe the config could introduce a parameter graph_api_version which will be appended only to the calls which are available under versioned urls. What do you think?

Where do I set the App ID ?

Hello, sorry if this is not the right place to ask,

I see how to set the App Secret
but nothing about the App ID ?

how does this work?

thanks

Unable to read env key

I'm having the following error:
** (RuntimeError) unable to read env key: appsecret for app: facebook lib/facebook/config.ex:2: Facebook.Config.get_env/1 lib/facebook.ex:71: Facebook.me/2

Even after setting the environment variable in a .env file, and setting the config.exs like so:

config :facebook, Users.Facebook, appsecret: System.get_env("FB_ACCESS_TOKEN")

Any advice?

Facebook Page info

I am writing a little experimental service in Elixir and need to access info about a user's facebook pages. Would you accept a PR for adding a basic wrapper for the /page node?

It looks like I could pretty easily follow the current code for /me, any concerns or other design we should do?

New version

Could you release the new version to hex.pm?

Error when request to Graph API

I request to /me

fields = ["name", "birthday", "first_name", "last_name", "address", "gender", "email"]
Facebook.me(fields, access_token)

But it raise an error:

[error] #PID<0.1058.0> running App.Endpoint terminated
Server: localhost:80 (http)
Request: POST /api/users/fb_sign_in
** (exit) an exception was raised:
    ** (UndefinedFunctionError) undefined function: :hmac.hexlify/2 (module :hmac is not available)
        :hmac.hexlify(<<101, 133, 65, 126, 95, 129, 67, 126, 54, 42, 27, 31, 160, 99, 106, 211, 84, 26, 178, 44, 77, 212, 157, 80, 223, 244, 216, 36, 8, 154, 254, 179>>, [:string, :lower])
        lib/facebook.ex:79: Facebook.me/3
        (app) web/controllers/api/user_controller.ex:31: App.Api.UserController.fb_sign_in/2
        (app) web/controllers/api/user_controller.ex:1: App.Api.UserController.action/2
        (app) web/controllers/api/user_controller.ex:1: App.Api.UserController.phoenix_controller_pipeline/2
        (app) lib/phoenix/router.ex:255: App.Router.dispatch/2
        (app) web/router.ex:1: App.Router.do_call/2
        (app) lib/app/endpoint.ex:1: App.Endpoint.phoenix_pipeline/1
        (app) lib/plug/debugger.ex:90: App.Endpoint."call (overridable 3)"/2
        (app) lib/phoenix/endpoint/render_errors.ex:34: App.Endpoint.call/2
        (plug) lib/plug/adapters/cowboy/handler.ex:15: Plug.Adapters.Cowboy.Handler.upgrade/4
        (cowboy) src/cowboy_protocol.erl:442: :cowboy_protocol.execute/4

Ability to add custom params and few other features

Thank you for all the effort, a really useful library to have in elixir.
One issue faced was providing custom parameters like "since" etc and also, not having a clean abstraction for things like getting the next page in a feed or the previous. I have started designing the flow a bit.
Is it something that current users of the library will find useful ? If yes, I will get a PR ready in a short while.
Thanks.

Can't request me object: Hackney config

Hi.

I have followed the instructions to get my user's basic info, and I'm getting a missing Hackney config error. These are the steps I'm taking:

  1. Install the dependency
{:facebook, "~> 0.20.0"}
  1. Create my own Facebook app and get an access token

  2. When I try to follow the example, I get

 Facebook.me("name,first_name", TOKEN)
=> ** (ArgumentError) argument error
    (stdlib) :ets.lookup_element(:hackney_config, :mod_metrics, 2)
    /app/deps/hackney/src/hackney_metrics.erl:27: :hackney_metrics.get_engine/0
    /app/deps/hackney/src/hackney_connect.erl:69: :hackney_connect.create_connection/5
    /app/deps/hackney/src/hackney_connect.erl:37: :hackney_connect.connect/5
    /app/deps/hackney/src/hackney.erl:316: :hackney.request/5
    lib/httpoison/base.ex:439: HTTPoison.Base.request/9
    lib/facebook.ex:174: Facebook.me/2

Am I missing some configuration?

Inconsistent Returns

Noticed that some methods return a tuple, like:

{:json, %{"email" => email}} = Facebook.me([fields: "email"], access_token)

Whereas other methods return a map, like:

%{"access_token" => access_token} = Facebook.accessToken

Is this done for a particular reason? If not, would you be open to a PR that makes the returns consistent?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.