{"id":15590534,"url":"https://github.com/coderberry/facilbook","last_synced_at":"2025-08-27T03:04:13.949Z","repository":{"id":2002351,"uuid":"2935885","full_name":"coderberry/facilbook","owner":"coderberry","description":"Simple Facebook Navigation and Helpers for Rails (used with OmniAuth)","archived":false,"fork":false,"pushed_at":"2011-12-07T23:13:09.000Z","size":100,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-08-09T20:30:14.452Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/coderberry.png","metadata":{"files":{"readme":"README.markdown","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2011-12-07T21:38:41.000Z","updated_at":"2013-10-11T01:59:24.000Z","dependencies_parsed_at":"2022-09-21T11:11:26.020Z","dependency_job_id":null,"html_url":"https://github.com/coderberry/facilbook","commit_stats":null,"previous_names":["cavneb/facilbook"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/coderberry/facilbook","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderberry%2Ffacilbook","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderberry%2Ffacilbook/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderberry%2Ffacilbook/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderberry%2Ffacilbook/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/coderberry","download_url":"https://codeload.github.com/coderberry/facilbook/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderberry%2Ffacilbook/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272283181,"owners_count":24906630,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-27T02:00:09.397Z","response_time":76,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-02T23:22:38.477Z","updated_at":"2025-08-27T03:04:13.920Z","avatar_url":"https://github.com/coderberry.png","language":"Ruby","readme":"![](https://img.skitch.com/20111207-npqgk2tdkndf7enpgurgt9t48q.jpg)\n\nFacilBook - Simple Facebook Navigation\n======================================\n\nFacilbook is a set of tools that makes navigation with Facebook easy. See usage below.\n\nFacilbook is used in conjuction with Omniauth for Facebook.  It is recommended that you have authentication in place\nusing the `omniauth-facebook` gem (see the [Simple Omniauth Railscast](http://railscasts.com/episodes/241-simple-omniauth))\n\nOne of the best features of this gem is that it places the decrypted signed request into the request scope.\nAnywhere in the application you can access this via @signed_request.\n\n## Getting Started\n\n0 - Prerequisite: You need a facebook app.  Have your API Key, Application\nSecret, and Application ID handy.\n\n1 - Add `gem 'facilbook'` to your Gemfile and run `bundle install`.\n\n2 - Create `config/facilbook_config.yml` with the appropriate environments.\n\n    production:\n      app_id: \u003cyour application id\u003e\n      app_secret: \u003cyour application secret\u003e\n      facebook_app_url: http://apps.facebook.com/\u003cyour app name\u003e\n\nThis data will be in your facebook settings. For example:\n\n![](https://img.skitch.com/20111207-rwx33b5q4g7yk82gat5yrkhwtw.jpg)\n\n3 - Create `config/initializers/load_facilbook_config.rb` and place the following in it\n\n    raw_config = File.read(\"#{Rails.root}/config/facilbook_config.yml\")\n    FACILBOOK_CONFIG = YAML.load(raw_config)[Rails.env].symbolize_keys\n    \nThis creates the static variable `FACILBOOK_CONFIG` which is used within the gem.\n\n4 - Add the following line to your `app/controllers/application_controller.rb`\n  \n  (add it right after the line class `ApplicationController \u003c ActionController::Base` so as to add the Facebooker2 instance methods to the Application controller)\n\n    include Facilbook::ApplicationControllerMethods\n\n5 - Add the following line to your `app/helpers/application_helper.rb`\n\n  (add it right after the line `module ApplicationHelper`\n\n    include Facilbook::ApplicationHelperMethods\n\n## Usage\n\n### Application Controller Methods\n\n**redirect_to_facebook(target_path)**\n\nRedirects to the Facebook url with the target path.\n\n      redirect_to_facebook(\"/foo/bar\")\n      \n      will redirect the user to the following url:\n      \n      http://apps.facebook.com/\u003cyour app name\u003e/foo/bar\n\n\n**current_user**\n\nReturns the current user that is either in the session, or one that exists with the same \nUID as the current Facebook user account. This is done via the `signed_request` from Facebook.\n\nThis assumes that there is a `User` model with the attributes :provider (being 'facebook') and :uid\nas explained in the [Railscast](http://railscasts.com/episodes/241-simple-omniauth) mentioned above.\n\n**url_for_facebook(path)**\n\nCreates a Facebook link using the relative path. This is accessible by any controller.\n\n      url_for_facebook(\"/foo/bar\")\n\n      creates the following:\n\n      \"http://apps.facebook.com/\u003cyour app name\u003e/foo/bar\"\n\n### Application Helper Methods\n\n**facebook_image_tag(uid, options = {})**\n\n*Loads the image of a Facebook user based on their Facebook UID.*\n    \n      Options\n        :type - Type of image to display. Can be 'square', 'small' or 'large'.\n        :size - Size of the image in width and height (example: 100x150)\n    \n      Examples:\n    \n        facebook_image_tag('100003043983036')\n        facebook_image_tag('100003043983036', { :size =\u003e '100x150' })\n        facebook_image_tag('100003043983036', { :type =\u003e 'small' })\n        \n**link_to_facebook(\\*args, \u0026block)**\n\nSame as link_to but ensures that the link directs the user to the parent window via a javascript onclick action.\nYou should only use the relative path as the first argument and never the full url.\n\n      link_to_facebook(\"/foo/bar\")\n      \n      creates the following:\n      \n      \u003ca href=\"#\" onclick=\"window.top.location='http://apps.facebook.com/\u003cyour app name\u003e/foo/bar'; return false;\" /\u003e\n      \n**url_for_facebook(path)**\n\nCreates a Facebook link using the relative path. This was created for use in Javascript.\n\n      url_for_facebook(\"/foo/bar\")\n\n      creates the following:\n\n      \"http://apps.facebook.com/\u003cyour app name\u003e/foo/bar\"","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoderberry%2Ffacilbook","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcoderberry%2Ffacilbook","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoderberry%2Ffacilbook/lists"}