Facebook integration

Hello,

For whoever is interested, i've written a little facebook application to integrate my zenphoto gallery into facebook. Photos are not uploaded to fb but rather directly fetched from the site, so this requires a few additional files to be installed on the gallery server. There may still be a few kinks, and some more testing may be needed (f.i. my host doesn't allow url rewriting so i have no idea how it will behave in that case). Anyway if you think this may be interesting i could open a trac issue and attach the sources. The url if you have a fb account and want to test it: http://apps.facebook.com/zenface

-- gd
«13

Comments

  • Hi,

    I've tested it and it works great for me -- using URL rewriting.
    However there is a detail you didn't mention, but which is very important if you want your app to work: you need PHP5 or your zp-facebook/common.php script will not work. It took me a little time to figure this out, but it works great once PHP5 is activated (on 1and1.fr you just have to add "AddType x-mapp-php5 .php" in your .htaccess).

    Thanks!
  • Thanks for testing. Indeed i forgot to mention the php5 issue (on free.fr you can also add "php 1" in the .htaccess file). I will update the user preferences page to inform about this detail.
  • Really too bad it requires PHP5. Would really like to use it but who knows what PHP5 would break on my system.
  • edasque,

    I come from a Java background and php5 seems way more natural to me than php4 - although it doesn't come without its flaws but i guess i'm just not fluent enough in php. Nevertheless if you want to give it a bit more testing, you could try to replace common.php with http://fbzp.free.fr/common-php4 (rename it to common.php). I can't garantee it will work but i have high hopes. If it does i'll update the zip file.
  • This worked quite well, gdodinet, with that php4 compatibility common file.

    Are you planning to add features ? Hit me if you need any suggestions, I have lots.
  • Erik,

    Thanks for testing! Actually i'm already working on the next version. I'm pretty overbooked recently so this doesn't progress really fast, thus i have just scratched the settings screens. I'll try to add profile box customization, virtual galleries, and integrate facebook "social" api (let your "friends" tag and add comments, filtered notifications, etc.).

    The next version is being developped under zenface-dev (btw i think the app canvas url seems odd now since the app has been renamed to zenbook due to facebook naming policy).

    On a different topic, I'm not notified when this subject is updated; and i wonder if it is possible to subscribe to a bbpress thread (to be notified by mail, without relying on a rss reader).
  • acrylian Administrator, Developer
    You can subscribe to the forum's complete feed or to a feed of a special thread. You should see the rss icon in your brower's adress bar.
    I believe there is no e-mail notification build in.
  • Too bad there's no email notification. I guess i'll have to learn how well rss is supported in gmail. Thanks.
  • Works well here \o/ just facebook is being really slow this end (nothing todo with my gallery or this app, just generally)
  • might be broken now. Or maybe 1.1.3 breaks it ?
  • I didn't test with 1.1.3. Seems to work fine on my end. Actually i don't touch the deployed application, i'm only working on the dev one (zenface-dev). Please note though that there's still a known bug: spaces in album path are not supported right now - spaces in album title are ok (the parameter 'album' references the album folder name, not the album name).
  • using 1.1.3 here and the facebook app is fine
  • I just tried this out on my gallery, using 1.1.3. The root loads, with thumbnails. However clicking on any of the albums results in an error "Error. Unexpected Error". The URL of the page that gives an error is http://apps.facebook.com/zenface/?q=album&owner=777235163&album=2007 September First Day School/

    I am using PHP5.

    Any thoughts?
  • Got the same error myself actually.
  • As i said before, spaces in album folder are not supported. You're trying to access the album "2007 September First Day School", At the moment you should store the album in a different folder (for instance 2007SeptemberFirstDaySchool). I'm not really sure why yet. The truth is that i thought this situation were quite uncommon. Seems it's not..
  • trisweb Administrator
    Yep, many people use spaces as it makes the title come through naturally. I do as well, and also had problems accessing those albums.

    Still very cool, thanks!
  • I don't have any spaces in my folders, it just says :

    Error
    Unexpected error.
  • pennyless,

    I've just changed a few things (in zenface-dev) in the way i retrieve the album name. The gallery page and album page are affected by those changes. So could you try to install zenface-dev (no changes are required concerning the integration files) and tell me if that fixes your problem ? I haven't yet tackled the whitespace issue.
  • So Zenface-dev is the name of the application in facebook (not released) but you can't search for it, you have to add it by hand.

    Let us know if the php code changes as well...
  • Indeed zenface-dev is the fb app, located at apps.facebook.com/zenface-dev. That's a good idea - adding a big note on the pref page whenever the integration need to be updated. I'll add that asap (well, more likely after the 2-day christmas break). Feature wise, zenface-dev is for now quite the same as zenface. I have almost finished polishing the settings screens.
  • if I may, on the profile box configuration, I'd put 3-5 random thumbnail, 3-5 random albums, 3-5 last albums, 3-5 last pictures, 3-5 last commented on ?

    What is tagged in zenface ? Is it the zenphoto tags ?
  • Erik,

    For now those settings are not effective (they're not concretized in the gallery pages). They can only be saved but are not used yet (and the friend includes/excludes list is actually not yet saved). However my idea was to allow tagging and commenting at zenphoto level: adding a tag (resp. a comment) in zenbook will imply a request to your zenphoto gallery - this is not a facebook's tag. So it is indeed a zenphoto tag.

    Concerning the profile box customization, i'm still not sure of its feasibility as running a cron is not an option here. If real time randomization is not possible, it will require a manual refresh of the profile box (through the settinqs page).

    Does this make sense ?
  • I have a recommendation, you know, we just get the myZenGallery button, anyway to load album thumbnails straight in the app box, or album titles?
  • So I installed the zenbook dev, here is the odd problem that its creating with my links,

    http://apps.facebook.com/zenface-dev/?q=album&owner=502738435&album=yself/

    That link the end should point to myself not yself so I can't figure out why its cutting apart my links, thats the source of my errors, if I mainly correct the url, it works fine.
  • Thanks for that info. I can't figure out neither what is the problem here. I'll add some client-side debugging capabilities so that you can have more hints about what could be going wrong ; it will make things easier for me to fix. This won't be done before a few days though.
  • no big rush here
  • gdodinet, I don't understand the cron problem. I mean I understand many installations can't use it but what are you trying to do that a cron would solve ?
  • There are a couple of constraints within the facebook architecture we must deal with.

    Profile box content is statically cached. So pushing new user-dependent content (to randomize profile box content) requires to periodically refresh that content. It is usually done (on fb) with a cron task. It is actually, from what i've read, the preferred way to do it.

    Images are also cached by url. So we migt need to randomize the url as well. I think of a couple of options to attain profile box customization but i'm not sure of the feasibility of the solution. It would consist in accessing the resource through a randomized url. The image stream would be written on the response output, but before that new content should be pushed to the profile. I still need to try it to validate the approach.

    Alternatively displaying the last n albums on the profile box has a number of shortcomings. Since the communication between zenbook and zenphoto is (for now at least) unidirectional, zenbook would't be able to refresh the profile box when an album is added on the zenphoto side.

    That was quite a long explanation which, i hope, should clarify the profile box issues i'm facing right now.
  • Hello,

    I've added some minimalist client-side debugging support in zenbook dev (server-side controlled through configuration). On the gallery page, after the album list, the album name construction steps are listed for each album. If you experiment some issues with the album names, please have a look at it and let me know how the name is retrieved.

    Additionally i've added some pseudo-random profile content: When random profile box style is chosen (on form submit), we grab 12 random images on the zp site, and push them to the profile box as <fb:random-option>. This solution is still not ideal though functionnal (please note that profile content is not yet polished - i still need to add gallery info). I might add later an option to specify the number of random items to fetch.

    You will need to update your integration files to see those changes (link on zb-dev general settings page).
  • acrylian Administrator, Developer
    goddinet: I have added an article for this to our extensions page so that it's easier to find and linked to this thread: http://www.zenphoto.org/2007/12/facebook-integration/

    I took bascially your first post as a description for now.
Sign In or Register to comment.