<commit_before>=begin rdoc

== Fetching Wall posts

=== User Wall

  FbGraph::User.new(username).feed
  # => Array of FbGraph::Post

=== Page Wall

  FbGraph::Page.new(page_id).feed
  # => Array of FbGraph::Post

=== Application Wall

  FbGraph::Application.new(page_id).feed
  # => Array of FbGraph::Post

=== Event Wall

  FbGraph::Event.new(page_id).feed
  # => Array of FbGraph::Post

=== Group Wall

  FbGraph::Group.new(page_id).feed
  # => Array of FbGraph::Post

== Updating Wall

See details here: http://developers.facebook.com/docs/reference/api/post

=== User Wall

  me = FbGraph::User.me(ACCESS_TOKEN)
  me.feed!(
    :message => 'Updating via FbGraph',
    :picture => 'https://graph.facebook.com/matake/picture',
    :link => 'http://github.com/nov/fb_graph',
    :name => 'FbGraph',
    :description => 'A Ruby wrapper for Facebook Graph API'
  )

=== Page Wall

  page = FbGraph::Page.new(page_id)
  page.feed!(
    :access_token => ACCESS_TOKEN,
    :message => 'Updating via FbGraph',
    :picture => 'https://graph.facebook.com/matake/picture',
    :link => 'http://github.com/nov/fb_graph',
    :name => 'FbGraph',
    :description => 'A Ruby wrapper for Facebook Graph API'
  )

* You need the page admin's access_token
=end

module FbGraph::Connections::Feed
  def feed(options = {})
    posts = self.connection(:feed, options)
    posts.map! do |post|
      Post.new(post.delete(:id), post.merge(
        :access_token => options[:access_token] || self.access_token
      ))
    end
  end

  def feed!(options = {})
    post = post(options.merge(:connection => 'feed'))
    Post.new(post.delete(:id), options.merge(post).merge(
      :access_token => options[:access_token] || self.access_token
    ))
  end
end<commit_msg>more rdoc<commit_after>=begin rdoc

== Fetching Wall posts

=== User Wall

  FbGraph::User.new(username).feed
  # => Array of FbGraph::Post

=== Page Wall

  FbGraph::Page.new(page_id).feed
  # => Array of FbGraph::Post

=== Application Wall

  FbGraph::Application.new(page_id).feed
  # => Array of FbGraph::Post

=== Event Wall

  FbGraph::Event.new(page_id).feed
  # => Array of FbGraph::Post

=== Group Wall

  FbGraph::Group.new(page_id).feed
  # => Array of FbGraph::Post

== Updating Wall

* See supported arguments here http://developers.facebook.com/docs/reference/api/post
* You need admin user's access_token to update Page/Application/Event/Group wall as itself

=== User Wall

  me = FbGraph::User.me(ACCESS_TOKEN)
  me.feed!(
    :message => 'Updating via FbGraph'
  )

=== Page Wall

  page = FbGraph::Page.new(page_id)
  page.feed!(
    :access_token => ACCESS_TOKEN,
    :message => 'Updating via FbGraph'
  )

=== Application Wall

  application = FbGraph::Page.new(application_id)
  application.feed!(
    :access_token => ACCESS_TOKEN,
    :message => 'Updating via FbGraph'
  )

=== Event Wall

  event = FbGraph::Event.new(event_id)
  event.feed!(
    :access_token => ACCESS_TOKEN,
    :message => 'Updating via FbGraph'
  )

=== Group Wall

  group = FbGraph::Group.new(group_id)
  group.feed!(
    :access_token => ACCESS_TOKEN,
    :message => 'Updating via FbGraph'
  )

=end

module FbGraph::Connections::Feed
  def feed(options = {})
    posts = self.connection(:feed, options)
    posts.map! do |post|
      Post.new(post.delete(:id), post.merge(
        :access_token => options[:access_token] || self.access_token
      ))
    end
  end

  def feed!(options = {})
    post = post(options.merge(:connection => 'feed'))
    Post.new(post.delete(:id), options.merge(post).merge(
      :access_token => options[:access_token] || self.access_token
    ))
  end
end
{'fraction_non_alphanumeric': 0.15471283319593296, 'fraction_numerical': 0.0, 'mean_word_length': 3.6192893401015227, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 39, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1762714', 'n_tokens_mistral': 1261, 'n_tokens_neox': 1248, 'n_words': 261}