šŸš€ Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more →
Socket
Sign inDemoInstall
Socket

railway-facebook-api

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

railway-facebook-api

railway railwayjs nodejs node facebook

0.0.1
latest
Source
npm
Version published
Weekly downloads
1
-75%
Maintainers
1
Weekly downloads
Ā 
Created
Source

RailwayJS Facebook API

Sync/Async FB OpenGraph API Interaction for RailwayJS

Installation

railway install https://github.com/1602/railway-twitter.git

Requirements

  • railwayjs
  • everyauth/mongoose-auth (implemented on environment)

Configuration

Include in npmfile.js : require('railway-twitter');

Usage

Sync Way :

			action('mycontroller', function () {
			  railway.tools.fbapi.friends(request,function(data){
			    render({friends:data});
			  });
			});

Async Way! :

			action('mycontroller', function () {
			   var socket_key = railway.tools.fbapi.friends(request);
			   render({socket_key: socket_key});
			});

Include in you template (Jade):

			script
			  $(function() {
			  if ("#{socket_key}" != "undefined")
			    {
			      var socket = io.connect();
			      socket.on('connect', function() {
			        // identify this socket with our auth token
			        socket.emit('auth', '#{socket_key}');
			        // called when a friend is received
			        socket.on('friend', function(friend) {
			          console.log(friend);
			        });
			      });
			    }
			  });
			script(src="/socket.io/socket.io.js")

FAQs

Package last updated on 14 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