Hi,
Has anyone ever tried to extend this project to comment and post as a user?
If not what will be the best way to tackle this challenge?
Tnx
Hi,
Posting chat messages or commenting/posting looks similar but it's rather different in the way it works. The first one uses an open connection/polling while the other one uses a classical request/responses way of handling the messages.
I would prefer for this module to stay focused on the "live chat" functionality, but there is certainly a way to offer the functionalities you want in an other module. The best would be to split this module in two (ie. facebook-request and facebook-chat-api). The first one would keep all the authentication/cookie acquisition methods and would be reusable. The chat API would rely on this first module and focus on the chat. A module for async operations/account management could then be created on top of the first module without interfering with this one.
(Also, maybe throw a few of shared objects if it's possible, but I'm not really sure to which extent the objects are similar between the ones used by the chat and the comments/posts).
Hey @ido43210, anything unrelated to FB chat is beyond the scope of this project. If you want to, you should be able to fork this project and add your own file in src and add that file name here which will then allow you to access your own function doing api.yourFunc.
Forking this repo will allow you to not have to re-write all the login stuff.
Then you can look at how searchForThread works as it is a simple example. The way we've figured out how Facebook does everything has always been simply open the chrome inspector and record all the networking, then do the thing you want to do, then look at the packet sent. Make sure to check the cookies that it sends and all the headers. Then make an API out of it :D
@Demurgos I'm a little worried about making another sub-module just for modularity's sake. I'd rather people fork for now and see how it goes. If this becomes more of an issue we can re-address.
@bsansouci Ok, I totally understand it (using a submodule comes with a lot of complications :/). It was just an idea if the need for more tools related to facebook and requiring the credentials arises. (And it shouldn't be a common need ?)
Agreed. But @Schmavery and I probably wouldn't have the patience for making those tools as it is a lot of work. If more people start working on the, we'll consider making the logging stuff into its own module.
Most helpful comment
Hey @ido43210, anything unrelated to FB chat is beyond the scope of this project. If you want to, you should be able to fork this project and add your own file in
srcand add that file name here which will then allow you to access your own function doingapi.yourFunc.Forking this repo will allow you to not have to re-write all the login stuff.
Then you can look at how searchForThread works as it is a simple example. The way we've figured out how Facebook does everything has always been simply open the chrome inspector and record all the networking, then do the thing you want to do, then look at the packet sent. Make sure to check the cookies that it sends and all the headers. Then make an API out of it :D
@Demurgos I'm a little worried about making another sub-module just for modularity's sake. I'd rather people fork for now and see how it goes. If this becomes more of an issue we can re-address.