在Facebook页面上发布的简单方式(不是个人资料,而是粉丝) [英] Easy way of posting on Facebook page (not a profile but a fanpage)

查看:126
本文介绍了在Facebook页面上发布的简单方式(不是个人资料,而是粉丝)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

实际上,哪个选项是在Facebook页面上发布文字或其他内容的最好和最简单的方法?

actually, which option is the best and easy way to post an text or something else on a facebook page?

我的意思是,我直接寻找从我的rails应用程序中放一些东西。

I mean, I looking for a directly way to put something there from my rails application.

像点击一个按钮,并自动发布在我的应用程序并发送Facebook页面的数据?

like clicking on a button and automatically post on my application and send data for the facebook page?

使用Twitter我有一个这样的简单方法:

With Twitter I have a simple method like this:

def tweet(url)
  Twitter.configure do |config|
    config.consumer_key = APP_CONFIG['twitter_consumer_key']
    config.consumer_secret = APP_CONFIG['twitter_consumer_secret']
    config.oauth_token = APP_CONFIG['twitter_access_token']
    config.oauth_token_secret = APP_CONFIG['twitter_secret_token']
  end    
  shorted_url = shorten_url(url)
  Twitter.update("#{title} - #{shorted_url}")
end

谢谢。

推荐答案

p>您可以按照此链接
什么是最简单的方式,通过我的Ruby on Rails应用程序发布在我的Facebook墙上?

You can follow this link What's the easiest way, to post on my Facebook Wall through my Ruby on Rails App?

这是我的方法如何:

def facebook_it(url)
  pages = FbGraph::User.me(APP_CONFIG['facebook_access_token']).accounts.first
  shorten_url = shorten_url(url) # create a bit.ly link
  pages.feed!(
    :message => "#{title}",
    :link => shorten_url,
    :description => "#{content[0..280]}"
  )
end

还创建了另一种方法:

def share(url)
  tweet(url)
  facebook_it(url)
end

所以我从控制器这样调用它: p>

so I call it this way from the controller:

def publish
  url = job_url(@job)
  @job = Job.find(params[:id])
  @job.publish
  @job.share(url)
  ..
end

我不知道这是否是更好的方法,但它对我来说很好。

I don't know if this is the better approach, but it's working nice for me.

希望这有助于别人。

这篇关于在Facebook页面上发布的简单方式(不是个人资料,而是粉丝)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆