使用 C# 将帖子发布到 Facebook 应用程序墙上
我正在尝试编写一个脚本,将帖子发布到我的 Facebook 应用程序墙上。我可以进行简单的状态更新,但是当我尝试转到带有链接、图像和描述的帖子时,格式会变得混乱。
dynamic parameters = new ExpandoObject();
//define parameters of the post
parameters.message = flyer.Description;
parameters.link = flyer.Link;
parameters.picture = webDomain + "/Resource/" + flyer.FileName;
parameters.name = flyer.Title;
parameters.caption = "this is a caption";
parameters.description = "this is a description";
//make the post
var result = (IDictionary<string, object>)fb.Post("/" + APPID + "/feed",parameters);
图片不显示。它只是左侧的一条灰线,也就是图像应该在的位置。标题显示正确,但它不是文章的链接,而是图像的链接。标题、消息和说明均正确显示。
I'm trying to write a script that will publish posts to my Facebook application's wall. I can do a simple status update, but when I try to move to a post with a link, image, and description the formatting gets messed up.
dynamic parameters = new ExpandoObject();
//define parameters of the post
parameters.message = flyer.Description;
parameters.link = flyer.Link;
parameters.picture = webDomain + "/Resource/" + flyer.FileName;
parameters.name = flyer.Title;
parameters.caption = "this is a caption";
parameters.description = "this is a description";
//make the post
var result = (IDictionary<string, object>)fb.Post("/" + APPID + "/feed",parameters);
The picture doesn't display. It is just a gray line on the left side, where the image should be. The title displays correctly, but instead of being a link to the article, it's a link to the image. the caption, message, and description all show up correctly.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
想通了。效果很好。问题是我正在本地主机上进行测试。当我将链接切换到开发站点时,它工作正常。上面的代码工作正常。
figured it out. that works fine. the problem was that I was testing on localhost. when I switched the links to the dev site it worked fine. The above code works fine.