specious / facebook-cli

:computer: Facebook command line client (needs to be updated)
https://asciinema.org/a/87129
397 stars 35 forks source link

Post to FB page? #12

Closed AstroFloyd closed 7 years ago

AstroFloyd commented 7 years ago

Thank you for facebook-cli. I was wondering whether it is possible to post to post a message/image/link/video to an existing (company) page rather than my personal wall. On the FB apps page, all I can do is create a new page for the app. (This is a question, not an issue). Thanks for your time :-)

insidenothing commented 7 years ago

just got to this point, then noticed no page command ( yet ) ( learning gem/ruby now )

specious commented 7 years ago

I'm excited that you guys are enjoying facebook-cli 👍

I'm noticing there's a lot of interest in posting to a page or a group. There are two pull requests open that add group posting ability: #5 and #10.

I'm working on an elegant way to post to your timeline, a page or a group without adding superfluous complexity to the application.

I'm thinking of using Koala's put_connections method directly to handle all of that.

specious commented 7 years ago

Post to pages and groups using --to <page-or-group-id-or-alias>with facebook-cli 1.6.0.

Example of posting a video to a page using facebook-cli 1.6.0

Video posted to a facebook page with facebook-cli

specious commented 7 years ago

I discovered that put_wall_post(), put_picture() and put_video() all support a target object (page, group, feed) identifier.

I'm really enjoying @arsduo's wonderful job with Koala.

shfrs commented 7 years ago

Hi, I got this error when trying post to group, what's wrong with my command? $ facebook-cli post --to 933655546775648 Test $ Koala OAuthException (code 200) HTTP status: 403 (#200) Insufficient permission to post to target on behalf of the viewer (FB trace id: CSEfqkFSend)

$ facebook-cli -v facebook-cli version 1.6.1

marteaurouge commented 6 years ago

I get the same code 200 error, any help?

specious commented 6 years ago

It looks like a permission problem. @shfrs, are you definitely a member of the group you are trying to post to and are able to post using the standard web interface?

By the way, 1.6.5 is currently the latest version of facebook-cli. I recommend running:

gem update facebook-cli.

specious commented 6 years ago

@marteaurouge, could you please post the exact command you are running and the entire output, as well as the version of facebook-cli you've got?

paum3 commented 6 years ago

Hi I have the same problem.

191684291417171 iD of my private group

$ ./facebook-cli post --to=191684291417171 "hello" Koala OAuthException (code 200) HTTP status: 403 (#200) Insufficient permission to post to target on behalf of the viewer (FB trace id: EBcAYwLbICy)

$ ./facebook-cli --version facebook-cli version 1.6.5