Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

facebook_wall

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

facebook_wall

  • 1.0.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

= facebook_wall

facebook_wall is a very simple library that fetches the latest wall-posts for a Facebook page without having to log in - wall posts are taken from the page's RSS feed. The markup in posts is filtered to help ensure standards-compliance and prevent errors when inserted into your own Web pages.

== Requirements

facebook_wall was written and tested on Ruby 1.9.2 but is likely to work on other versions. It requires no 3rd-party libraries - it uses the open-uri and RSS libs from the Standard Library.

== Installation

Using Bundler:

gem 'facebook_wall'

or:

gem 'facebook_wall', :git => 'git://github.com/archaichorizon/ruby-facebook-wall.git'

== Usage

The following example prints the latest wall-post from {Archaic Horizon's Facebook page}[http://www.facebook.com/archaichorizon].

require 'facebook_wall'

facebook_wall_posts = FacebookWall::posts_by 260041833284 latest_wall_post = facebook_wall_posts.first

puts latest_wall_post.description

FacebookWall::posts_by returns an Array containing instances of FacebookWall::Post. FacebookWall::Post decorates RSS::Rss::Channel::Item, which means you can easily access all sub-elements of items published in a page's feed. For example:

post.title # => A title automatically generated by Facebook post.link # => The URL of the wall post post.description # => The content of the wall post post.pubDate # => The date the post was published post.author # => The author of the post

== Filters

The library applies two filters to each item in the feed:

  • FacebookWall::FeedEntryFilters::LinkRewriter completely rewrites HTML links in items, removing superfluous attributes added by Facebook.
  • FacebookWall::FeedEntryFilters::Paragraphizer wraps 'plain' paragraphs with P tags to create semantically-correct HTML.

You can insert your own filters into the chain by adding subclasses of FacebookWall::FeedEntryFilters::FeedEntryFilter to the FacebookWall::FeedEntryFilters module. The following filter, for example, would append the word "foo" to the description of each item.

module FacebookWall module FeedEntryFilters class CustomFilter < FeedEntryFilter def apply!(feed_entry) feed_entry.description << 'foo' end end end end

FAQs

Package last updated on 20 Mar 2012

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc