Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > HOWTO-Related Questions

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 24th October 2007, 21:47
godrox godrox is offline
Junior Member
 
Join Date: Oct 2007
Posts: 2
Thanks: 0
Thanked 1 Time in 1 Post
Exclamation Facebook RSS feed app invite page deprecated

I used the tutorial for how to set up a Facebook reader application for your blog and it worked great until just recently when Facebook deprecated the notifications.sendRequest API method.

I know get this error when sending invites:

Code:
Fatal error: Uncaught exception ‘FacebookRestClientException’ with message ‘Unknown method (this function has been disabled - see http://developers.facebook.com/news.php?story=42)’ in /home/rest_of_path/facebookapi_php5_restlib.php:390 Stack trace: #0 /home/rest_of_path/facebookapi_php5_restlib.php(270): FacebookRestClient->call_method(’facebook.notifi…’, Array) #1 /home/rest_of_path/invite.php(18): FacebookRestClient->notifications_sendRequest(Array, ‘Drink and Flow …’, ‘
Can anyone tell me how to update the invite page for this app with Facebook's new invite system? Or even update the HOWTO tutorial on it?
Reply With Quote
Sponsored Links
  #2  
Old 25th October 2007, 08:29
godrox godrox is offline
Junior Member
 
Join Date: Oct 2007
Posts: 2
Thanks: 0
Thanked 1 Time in 1 Post
Default

Okay, I updated it myself. In case anyone else is looking for directions:

1. Delete the friendselect.php file from your host. It's deprecated and is no longer needed.

2. Overwrite facebook.php and facebookapi_php5_restlib.php on your host with the new ones from the Facebook client package.

3. Open invite.php and delete everything in it. Replace it all with this:

Code:
<?php
include_once 'conf.php';

require_once('appinclude.php');

$facebook->require_frame();
$user = $facebook->require_login();

// Render the friend selector in an iframe.
?>
<div style="padding: 10px;">
  <fb:request-form method="post" action="index.php" content="DESCRIPTION OF YOUR APP HERE <?php echo htmlentities("<fb:req-choice url=\"CANVAS_PAGE_URL_HERE\" label=\"Sweet! Add it!\" />"); ?>" type="SHORT APP NAME" invite="true">
  <fb:multi-friend-selector actiontext="Select your friends to use the APPLICATION NAME!" rows="3"/>
  </fb:request-form>
</div>
<?php
?>
Replace "DESCRIPTION OF YOUR APP HERE" with a brief description of your application.

Replace "CANVAS_PAGE_URL_HERE" with your canvas URL. Be sure to leave the backslash intact.

Replace "SHORT APP NAME" with a very short name of your app. No longer than 15 characters or it'll cut off in people's right sidebar when they receive the invite notification.

Replace "APPLICATION NAME" with the name of your application.

Save the file and overwrite your existing one. The invitation system now works again.
Reply With Quote
The Following User Says Thank You to godrox For This Useful Post:
falko (25th October 2007)
  #3  
Old 8th January 2008, 16:32
ray_gillespie ray_gillespie is offline
Junior Member
 
Join Date: Jan 2008
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

That's really helpful, thanks!

Do you know of any way to limit the number of threads?
Reply With Quote
  #4  
Old 9th January 2008, 17:45
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,751 Times in 2,581 Posts
Default

You mean the number of stories that are shown? Take a look here: http://www.howtoforge.com/forums/sho...light=facebook
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #5  
Old 9th January 2008, 17:50
ray_gillespie ray_gillespie is offline
Junior Member
 
Join Date: Jan 2008
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

That's cool, thanks!
Reply With Quote
  #6  
Old 2nd November 2008, 16:44
spectrelives spectrelives is offline
Junior Member
 
Join Date: Nov 2008
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Unhappy No longer working?

Hi Falko and others.

I'm trying to do this tutorial desperately as I am using it to help me do a uni assignment (with full references to HowToForge of course!). However I'm concerned that ever since the new Facebook layout took over, this tutorial no longer seems to work.

There is a problem with isAppAdded() which will always return false now. This leads to an infinite loop (Too Many Redirections) error and the whole app breaks. Facebook reckon this is no longer necessary as the checks are done within require_login() automatically.

When this try/catch block is removed, however, I run into an even bigger problem. My application will not load the HowtoForge feed, nor any feed. Instead, I get:

Fatal error: Uncaught exception 'FacebookRestClientException' with message 'Session key invalid or no longer valid'.

and sometimes, instead I get the Fatal Error "Incorrect Signature".

Is this just me? or is the tutorial broken?
If it's just me, I don't know why as I followed the tutorial exactly step by step up to page 3 and it will not load any RSS feeds like it should.

Please, please help... any code I could try?
Thank you
Reply With Quote
  #7  
Old 3rd November 2008, 16:17
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,751 Times in 2,581 Posts
Default

The feedreader is still working for me, even with the new Facebook design. I guess that something's wrong with your session key.
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #8  
Old 3rd November 2008, 16:42
spectrelives spectrelives is offline
Junior Member
 
Join Date: Nov 2008
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Unhappy

How strange. Just curious, so with the new Facebook Layout, is the Feed reader displaying in the new wall as a profile box in the same way? What about dislaying as a Profile Tab, is that automatically working too?

Back to my problem: apologies, because I am a beginner at all of this, but what is the best way to clear/refresh my session key? I don't really understand how session keys are stored, where they are stored, or how come mine is apparently broken.

This might be a clue: it works the very first time I install the app. Once I allow it access in Facebook, it loads. Then, the next time I refresh or go to the application again, it shows the error. This is regardless of whether I log out of Facebook, shut down the browser window, clear cookies, or restart my computer. The only thing I can do to get it to work is to REMOVE the application, then re-add it all over again. Sound strange to you?

This incorrect signature / invalid session key has has me stumped for days. Is it a PHP method I have to call, or a FBML method? Any tips would be massively helpful and thanks again for your time on this one
Reply With Quote
  #9  
Old 4th November 2008, 15:00
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,751 Times in 2,581 Posts
Default

It's displaying on the Boxes tab, but not on the Wall tab.

Did you try the procedure from the tutorial to get the session key?
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #10  
Old 5th November 2008, 13:18
spectrelives spectrelives is offline
Junior Member
 
Join Date: Nov 2008
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
 
Unhappy Session Key

Well, when you say 'the procedure to get the session key' do you mean this block of code?


//catch the exception that gets thrown if the cookie has an invalid session_key in it
try {
if (!$facebook->api_client->users_isAppAdded()) {
$facebook->redirect($facebook->get_add_url());
}
} catch (Exception $ex) {
//this will clear cookies for your application and redirect them to a login prompt
$facebook->set_user(null, null);
$facebook->redirect($appcallbackurl);
}


When I put that code in, it resulted in Error: too many redirections.
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Howtos RSS feed? edge Suggest HOWTO 8 14th February 2007 21:58


All times are GMT +2. The time now is 05:34.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.