console app

Mar 25, 2011 at 5:43 AM

First of all congratualations on an awesome idea.

I havent actually played with this current project so I can't comment on much but definitely love the idea.

I'm one of the core developers of Facebook C# SDK, so please feel free to post at incase you find any limitations. One of our goals of v5 is not just to make calling Facebook api easier but also to make api easier to consume based on real life examples. (You can actually see here that we listened to the developers and implemented a feature based on open discussion and thoughts.)

Looking at your source code, you have mentioned about powershell needs to be configured on .net 4 as Facebook C# SDK is .net 4. Might be you could try the .net v3.5 build of Facebook C# SDK. You can easily get this through nuget (Install-Pacakge Facebook). We curerntly support .net 3.5,.net 4.0 SL4 and WP7.

Actually i have been working on a similar project like yours but as a console app instead of powershell. As I wanted it to work with Mono along with mac and linux too.

$ .\fb.exe
usage: fb [--version] [--help] COMMAND [ARGS]

List of fb commands:
   get        Make a HTTP GET request to facebook.
   help       Displays the help.
   login      Login to facebook and retrieve access token.
   version    Displays the version information.


$ .\fb.exe login
usage: fb login [OPTIONS] 

   appid                Facebook application id (client_id).

   -c, --clipboard      Copy the access token to clipboard if successful.
   -q, --quiet          Do not dispaly the result to the console.
   -p=, --permissions=  Comma seperated list of extended permissions.

   fb login 124973200873702
   fb login -p=publish_stream -p=offline_access 124973200873702
   fb login -p=publish_stream,offline_access 124973200873702
   fb login -c --permissions=publish_stream,offline_access 5b493be0896314523

  * Facebook Authentication documentation:
  * Extended permissions documentation:

Currently it support the login. I still have to find time to implement GET,POST and DELETE. ;-)

I havent released the code to public as it is in a very early stage, but if you are interested let me know.

Here is a sample on how I actually wanted api calls to work work.

fb get "/me" access_token="...." fields="id,name"

That would then display the json result.

Apr 10, 2011 at 5:10 PM

Prabir, thank you for your suggestions. I apologize that it has taken me so long to respond – I’ve been working nights and weekends toward a deadline in my regular job.

You are 100% right about the .NET35 release of Facebook C# SDK. I have created a new drop over .NET 3.5, removing the infrastructure for managing .NET 4.0. I also added a drop to the Downloads, which I should have had from the beginning. I hope not too many people were turned off by the lack of a simple download. This is my first Codeplex project…

Your console app is an interesting concept. As you note, it would have more reach than a PowerShell 2.0 module, but at the cost of less flexibility. Interpreting text stream output is a pain. Have a look at my FacebookExamples.ps1 functions to see how FacebookPSModule integrates with built-in PowerShell capabilities to avoid the need for complex Perl scripts and the like.

Regarding the implementation of FacebookPSModule: The trickiest bit is actually the recursive descent translation of Facebook C# SDK’s JsonObject and JsonArray result values into PowerShell’s native PSObject type. I could actually have left them alone, but PowerShell users expect to be able to use syntax like ‘$friendList[$i].Name’ rather than ‘$friendList.Properties[“Data”].Value[$i].Properties[“Name”].Value’. .NET 4.0 DynamicObject does not enable this syntax.

The main thing I need isn’t actually technical assistance – it is real customer scenarios. I have taken care of my lead customer, but to validate this as a general-purpose module I need to test it against more scenarios. So, I’ll generate for free scripts for the first five real-life customer scenarios presented here. Ideally these should be scenarios which interact primarily with Facebook, I can’t solve problems involving customers’ SQL databases and the like. 


Jon Newman