Obtaining a Facebook auth token for a command-line (desktop) application

后端 未结 4 1605
梦谈多话
梦谈多话 2020-12-17 09:38

I am working for a charity which is promoting sign language, and they want to post a video to their FB page every day. There\'s a large (and growing) number of videos, so th

4条回答
  •  半阙折子戏
    2020-12-17 10:01

    as far as I recall, what you want isn't really possible without some kind of endpoint that can receive a callback from facebook.

    If you can finagle an oauth token, from say the Graph API Explorer, then it becomes pretty trivial to use a gem like koala to upload your video.

    here's the salient bit:

    @graph = Koala::Facebook::API.new(access_token)
    @graph.put_video(path_to_my_video)
    

    I've made you a sample project here: fb-upload-example

提交回复
热议问题