Upcoming scenarios 2011-11-04

Nov 4, 2011 at 11:21 PM

Based on user feedback, the following scenarios will be my next priority:

My primary user has an old group which has grown to more than 500 members, and needs to be ported to a page. These support scripts will assist in porting a group to a page:

  • Produce list of everyone in group X who is not on page Y
  • Send message/email to everyone above
  • Create an event and explicitly invite everyone on page Y

In addition, I have a request for scripts to copy all photos in a directory up to a Facebook album, and from a Facebook album back down.

PowerShell Superstars James Brundage and Jeff Truman discussed FacebookPSModule at the Script Club event at a recent PowerShell Deep Dive conference. I also have some useful feedback from them.



Nov 8, 2011 at 10:56 PM

Version 0.5.0 has some of these changes. I think the bulk photo upload/download is pretty cool. There is a known issue with download when multiple Facebook photos have the same name. I'm thinking of appending "(2)" etc. when that happens.

It doesn't look like there is an API to read the "members" of a page, so the best we can do is to contact everyone in the group. There also isn't a way to bulk-send Facebook messages (due to the spam problem), and very few people expose their email field. The best bet so far appears to be the Requests Dialog, I have to figure out how to integrate that.

At this writing, New-FBConnection appears to require ISE. It should be an easy fix, I just need to import the assembly containing System.Windows.Forms into PowerShell.exe -STA.

Do I need to keep publishing the MSI plus the component files, or is just the MSI enough? Should I look into this ClickOnce thing?



Nov 17, 2011 at 7:40 PM

Version 0.5.2 fixes the problem where multiple albums/photos have the same name. There still seems to be an issue where photos wind up with names like "My Vacation.jpg.jpg".

I think I have fixed the problem where New-FBConnection requires ISE. It should now work on all combinations of ISE, PowerShell -STA, .NET 3.5, and .NET 4.0. Let me know if you observe otherwise. Also, I'm wondering whether this should be named something like "Show-FBConnectionDialog", to signal that it requires user input and cannot be run in scheduled tasks and other GUI-free environments.

The automated tests turned up some issues with missing ID fields (e.g. "UserId") and PSTypeNames which I have fixed. I think I'll need to create Remove-FBPhoto in order to run automated tests in the long run.

I think I have a lead on invoking Requests Dialog, I'll be following up on that soon.

Nov 29, 2011 at 7:09 AM

Version 0.5.3 includes Show-FBMessageDialog. Graph API proper does not include a way to send Facebook messages (I think some earlier apps abused the privilege); however, you can use http://developers.facebook.com/docs/reference/dialogs/send/ to make it easier to send bulk messages by hand. Every 50 users must be in a seperate dialog instance, but the pipeline will take care of it automatically. The user will need to put something in the Message field for each dialog (use copy/paste as needed) and then click Send. There are limits on setting the Link to Facebook per http://stackoverflow.com/search?q=%5Bfacebook-graph-api%5D+and+send+dialog.

Also added: Get-FBGroup, Get-FBMember

I have also added the -Connection parameter to the relevant cmdlets, to make it easier to switch between different users.

I have also fixed the connection caching, so that it doesn't read the cache file on every command.

I have renamed New-FBConnection to Show-FBConnectionDialog for consistency. New-FBConnection is retained for now as an alias.

Dec 2, 2011 at 1:59 AM

Show-FBMessageDialog worked well in its first outing, blasting out 502 Facebook messages in batches of 50 in a couple minutes. This helped migrate users from an old Group to a new Page. There are some learnings though:

  1. I still don't fully understand the restrictions on the Link parameter. I wasn't able to link a Facebook page belonging to the sender, even with its username set. However, it works just fine to include a link in the Message, and the link is live inside the message. I should double-check that Link is really required by the API.
  2. If any one of the users in the To list is not a friend (presumably cannot receive messages), the whole dialog fails (the dialog never appears). The fix is to filter the To list to remove users who are not friends. I think I'll add a FriendsOnly switch parameter.
  3. One dialog invocation failed for no reason I can discern, so I missed 50 users, I need to try to figure out why it failed.
  4. I need to look again to see if there is any way to piece together whether the dialog worked or failed.