Re: [CODE4LIB] Facebook JSON results and the privacy problem

2010-06-21 Thread Ethan Gruber
Hmm, interesting.  Facebook is on the way out, anyway.  The question is what
social network, if any, will replace it.

On Mon, Jun 21, 2010 at 6:31 PM, Ranti Junus ranti.ju...@gmail.com wrote:

 For example:
 http://graph.facebook.com/search?q=whatever


 ranti.

 --
 Bulk mail.  Postage paid.



Re: [CODE4LIB] facebook

2008-01-07 Thread David Pattern
Thanks Eric!

I had a little mess around with the Perl Facebook API last year, but
didn't get very far.

Out of interest, once you've got the first fortune, when you refresh
your FB profile does it trigger a new fortune to be sent or do you see
the same (e.g. cached) fortune?

What I want to do is put together a small application that will give the
user info from their library account, e.g.

You have 5 books on loan, and 2 of them need returning tomorrow.
Click here to go to your library account if you'd like to renew
them.

Obviously I'd need to figure out a secure and safe way of associating a
Facebook user ID with a specific library account.

regards
Dave Pattern
Library Systems Manager
University of Huddersfield


-Original Message-
From: Code for Libraries [mailto:[EMAIL PROTECTED] On Behalf Of
Eric Lease Morgan
Sent: 07 January 2008 00:55
To: CODE4LIB@listserv.nd.edu
Subject: [CODE4LIB] facebook

I am having a bit of fun with Facebook.

Last Friday I got a renewed interest in Facebook. Don't ask me why. I
don't know. I do know though that syndicating library content to
social networks (Facebook, MySpace, Delicious, etc.) seems to be a
rage. To that end I have taken a stab at writing a few Facebook
applications, and below is the simplest one shared here in the hopes
other (Perl) hackers don't spin their wheels as much as I did.

...snip...

--
Eric Lease Morgan
University Libraries of Notre Dame






This transmission is confidential and may be legally privileged. If you receive 
it in error, please notify us immediately by e-mail and remove it from your 
system. If the content of this e-mail does not relate to the business of the 
University of Huddersfield, then we do not endorse it and will accept no 
liability.


Re: [CODE4LIB] facebook

2008-01-07 Thread Eric Lease Morgan

On Jan 7, 2008, at 6:16 AM, David Pattern wrote:


What I want to do is put together a small application that will give
the
user info from their library account, e.g.

   You have 5 books on loan, and 2
   of them need returning tomorrow.
   Click here to go to your library
   account if you'd like to renew
   them.

Obviously I'd need to figure out a secure and safe way of
associating a
Facebook user ID with a specific library account.




Yes, I've been thinking about the same thing. I think such a thing is
a challenge but not insurmountable.

--
Eric Lease Morgan


Re: [CODE4LIB] facebook

2008-01-07 Thread Joe Hourcle

On Mon, 7 Jan 2008, Eric Lease Morgan wrote:


On Jan 7, 2008, at 6:16 AM, David Pattern wrote:


What I want to do is put together a small application that will give
the
user info from their library account, e.g.

  You have 5 books on loan, and 2
  of them need returning tomorrow.
  Click here to go to your library
  account if you'd like to renew
  them.

Obviously I'd need to figure out a secure and safe way of
associating a
Facebook user ID with a specific library account.


Yes, I've been thinking about the same thing. I think such a thing is
a challenge but not insurmountable.


I'm no expert on facebook (I think I've logged into my account all of
twice), but I was the archtiect and wrote most of the framework for the
first incarnation of the portal for The George Washington University, so
I've done some similar linkages before.

If you have the ability to add an extra field to your user table, or add a
secondary table, I would suggest adding a special 'facebook-only' password
in your system.  (it could be user supplied, or system generated).

The idea of this extra password is that it would _only_ allow read-only
access through certain methods, and not the user's typical access.  You
can provide them a link to log into their account and get other
information, but then they'd have to supply their normal password.


With the extra password, it's something that could be changed without
having to completely remove the user's account and recreating it -- so if
something should get shared accidentally, you can remove access.  You
would also require the user to do something to add this field (it could
generate a value, then give them the code they need to insert into
Facebook), so they would have to explicitly opt-in.

You also have the advantage that it'd require a little bit of extra effort
if someone were to take a brute-force approach to get account information.
(not that they would, but you never know).


I'd be interested to know if anyone sees any flaws with my logic and/or
has an alternate solution.

-
Joe Hourcle


[CODE4LIB] facebook

2008-01-06 Thread Eric Lease Morgan

I am having a bit of fun with Facebook.

Last Friday I got a renewed interest in Facebook. Don't ask me why. I
don't know. I do know though that syndicating library content to
social networks (Facebook, MySpace, Delicious, etc.) seems to be a
rage. To that end I have taken a stab at writing a few Facebook
applications, and below is the simplest one shared here in the hopes
other (Perl) hackers don't spin their wheels as much as I did.

The purpose of the script is to output the results of the venerable
fortune command. Each time the program runs a new fortune will be
generated. (Actually, they are not fortunes as much as they are
interesting quotes.) The salient parts include:

  1. constructing a Facebook object
  2. determining the ID of the user
  3. sending the output the user's profile page
  4. redirecting the user's browser to their profile page

Here is the script for you reading pleasure:

  #!/usr/bin/perl

  # infomofortune - return a fortune to facebook

  # Eric Lease Morgan [EMAIL PROTECTED]
  # January 6, 2008 - first cut; whew!

  # require
  use CGI;
  use strict;
  use WWW::Facebook::API;

  # define
  use constant FORTUNE = '/usr/bin/fortune';

  # initialize
  my $cgi  = CGI-new;
  my $fbml = '';
  my $facebook = WWW::Facebook::API-new(
  api_key  = foo,
  secret   = bar,
  app_path = http://infomotions.com/facebook/;
  );

  # get the fortune
  my $fortune = '';
  open INPUT, FORTUNE . '|';
  while ( INPUT ) { $fortune .= $_ }
  close INPUT;

  # build the fbml
  $fbml .= $cgi-p({ style = 'font-size: small' }, $fortune );

  # get the user id
  my $uid = $facebook-canvas-get_user( $cgi );

  # done
  print $cgi-header;
  print $facebook-profile-set_fbml( markup = $fbml, uid = $uid );
  print $facebook-redirect( http://www.facebook.com/profile.php?id=$uid
, $cgi );
  exit;

It seems the key to writing cool Facebook applications is two-fold.
First, you need to know the API. It comes in many flavors and the
Facebook folks seem to endorse their PHP version. The Perl version
seems to work quite well. Second, it will be important to exploit the
social nature of Facebook and learn about the user and their friends.
The script above barely takes advantage of the API, and it does
nothing at all regarding social networking. My next steps will be to
write a interface to our library catalog that returns its output in
the Facebook interface. The next step will be to allow people to
create (MyLibrary) accounts and implement a recommender service based
on the user's and their friends' characteristics.

If you have a Facebook account, I think you can access and this and
the other two scripts I've written from the following URLs:

  http://www.facebook.com/apps/application.php?id=8210775807
  http://www.facebook.com/apps/application.php?id=8271966859
  http://www.facebook.com/apps/application.php?id=8397580822

Enjoy?

--
Eric Lease Morgan
University Libraries of Notre Dame