Conversation
lib/facebook.ex
Outdated
| @spec page_likes(page_id :: integer | String.t, access_token) :: integer | ||
| def page_likes(page_id, access_token) do | ||
| fan_count(page_id, access_token) | ||
| end |
There was a problem hiding this comment.
if we're breaking anyway then let's remove that function
|
That looks great, thanks for your work!
|
Hmmmm... I'll take a look now and see if I have any thoughts. If you don't hear from me then it's safe to say I just ran out of time tonight.
I'd only want it for formatting really, but TBH this isn't a deal-breaker for me. The codebase is small enough still that I generally had no issues with following the style already used. I don't mind doing the work to make it pass, but I also don't want to be intrusive on your project. Your pick :) Follow-up: the build's breaking, and it looks like there's issues picking up the env vars. Any ideas? I don't think I changed anything to make that break. EDIT: I'll restore the logging stuff you had in place. I took it out when I was working in |
I'm at the moment not doing much elixir (that's also why I don't do much on this library except reviewing code etc). So I'd rather have opinions of people actually using it ;) I.e. you, @jovannypcg @dcarneiro @brinco80 @tfinnell f.e.
I think that's related to it being a PR and secure variables of Travis-CI. I assume it passes on your side? I can run it locally as well to double check. |
I'd throw a +1 onto that vote. I'll wait to see if anyone else has thoughts.
Good question. Probably not 👍 I'll investigate when I have time to dig back into this PR, probably Weds/Thurs. |
|
While adding the video edges I had experimented with
|
I'm happy to do this, but I'll do it in another PR just so I'm not polluting this PR too much.
|
tfinnell
left a comment
There was a problem hiding this comment.
Functionality is testing out as expected in IEX, looks good.
Just noted GraphMock should probably only be defined once.
test/facebook_test.exs
Outdated
| %{"id" => id, "about" => about} = data | ||
| assert(String.length(about) > 0) | ||
| assert(id == Integer.to_string(@pageId, 10)) | ||
| defmodule Facebook.GraphMock do |
There was a problem hiding this comment.
This can be merged into the test/graph_mock.ex file
There was a problem hiding this comment.
So. I might be doing something wrong, but I was getting the following error when trying to use that module. Do you have any idea what I might be doing wrong? I thought mix test would compile it since it's an .ex file.
Edit: I think I'm just used to Phoenix which I'm pretty sure loads up test files like these.
.gitignore
Outdated
| doc | ||
| .DS_Store | ||
|
|
||
| # asdf |
There was a problem hiding this comment.
I don't see why these shouldn't go (I've got an .env as well that I don't want committed), but one tip is to add editor or environment variable files to a global gitignore.
https://help.github.com/articles/ignoring-files/#create-a-global-gitignore has more details
There was a problem hiding this comment.
Ahh ok. Is this just to prevent .gitignore pollution?
There was a problem hiding this comment.
Yup! It also helps prevent you from accidentally committing stuff and generally helps save you from having to edit .gitignores across projects.
|
That looks great! Thanks. I couldn't test it yet, hope I can do so today or tomorrow. |
|
|
||
| @appId System.get_env("FBEX_APP_ID") | ||
| @appSecret System.get_env("FBEX_APP_SECRET") | ||
| import Facebook.GraphMock |
There was a problem hiding this comment.
warning: unused import Facebook.GraphMock
test/facebook_test.exs:4
I think that import is not needed then?
|
Err, I merged with squashing but somehow in a wrong way so that GitHub didn't recognize it's actually your PR :/ sorry about that. |
|
Bummer, oh well not a big deal. Thanks for merging that in 👍 |

This is still a work-in-progress, but I've done the majority of the work that needs to be done. I wanted to get what I have so far to at least start getting feedback so I can address when I have some free time.
The mocks that I've wrapped tests in make things quite verbose. I'm v open to feedback if you have a more concise way of doing all that mocking.
Aside from the to-do list below, let me know if there's anything else you'd like to see tackled in this PR. I'm super happy to right some release notes since the changes introduced here are rather breaking :)
Still to do:
access_token(still don't know what's up), but I have one that works now. Will clean up in the next few daysfinish updating documentation. I was unfamiliar with these FB endpoints, so I found it rather difficult to get up and running (no fault of the lib IMO). I'd like to spend some time documenting how to get up and runningaddress in separate PR@specdefinitionsrestore logging# TODO, unnecessary dependenciesrun throughaddress in separate PRcredo. I'm open to not doing this if you'd rather me not impose credos coding style