Beispiel #1
0
        object IAppController.PublishPost(string sessionId, PostRqst post)
        {
            var app      = getApp(sessionId);
            var response = app.PublishPost(post);

            return(response);
        }
Beispiel #2
0
        FbPost IGraphApi.PublishPost(PostRqst post, FbPhoto[] photos, string token)
        {
            var sb = new StringBuilder(512);

            var fb      = _config.ApiBaseUrl;
            var pageId  = post.pageId;
            var message = post.message;

            sb.Append($"{fb}/{pageId}/feed?method=post&message={message}&access_token={token}");

            for (int index = 0; index < photos.Length; index++)
            {
                var fbid = photos[index].Id;
                sb
                .Append("&")
                .Append($"attached_media[{index}]=")
                .Append($"{{\"media_fbid\":\"{fbid}\"}}");
            }

            var url = sb.ToString();

            var info = _web.Get(url, onFbError, new {
                id = ""
            });

            return(new FbPost {
                Id = info.id
            });
        }
Beispiel #3
0
        FbPost IFacebookApp.PublishPost(PostRqst post)
        {
            var token = requirePageToken(post.pageId);

            var photos = _uploader.WaitFor(post.uploadIds, _config.WaitSpan);
            var reply  = _api.PublishPost(post, photos, token);

            return(reply);
        }
Beispiel #4
0
 FbPost IFacebookApp.PublishPost(PostRqst post) => d.tail(post, () => _.PublishPost(post));