Facebook wall posting problem using RPX

15 views
Skip to first unread message

Apurba

unread,
Sep 7, 2009, 7:39:55 AM9/7/09
to RPX Developers
Hi Everybody,

I have use RPX in my forum(Vbulletin).In that forum when any user
register.post or reply then it will be displayed in facebook wall. The
only problem is in action links. I use that code.

$api_key='fgfgfgfgfgf12121211';
$action_links = array('text' => 'Recaption this', 'href' => 'http://
mine.icanhascheezburger.com/default.aspx?tiid=1192742&recap=1#step2');
$post_data1 = array(
'apiKey' => $api_key,
'identifier' => $identifier, // <-- replace this with your own
API key.
'message' => ' has replied for a new thread in Couponwatchdog.To
view it go to, '.$url
'$action_links'=
$action_links

);

$curl = curl_init();
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_URL, 'https://rpxnow.com/api/v2/
facebook/stream.publish');
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data1);
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
$raw_json = curl_exec($curl);
curl_close($curl);
$json = new Services_JSON();
$value = $json->decode($raw_json);
if ($value->stat == 'ok')
{
echo "Posted in wall";
}else{
echo "not posted in wall";
}
if i delete the action links it is working fine. but by giving
action_links it does not post into wall.How i sent action link as a
parameter ? Plese help me.


Apurba

unread,
Sep 11, 2009, 2:57:56 AM9/11/09
to RPX Developers
anycan can help me? its very urgent

Ellin, Brian

unread,
Sep 11, 2009, 4:51:01 PM9/11/09
to rpx-dev...@googlegroups.com
You have a dollar sign '$' in your action_links parameter string.  I think that's it.

Apurba

unread,
Sep 14, 2009, 2:15:59 AM9/14/09
to RPX Developers
Thanks for replying. but i use action_links not $action_links ....
still it is not working.... how i can i resolve the issue.


On Sep 12, 1:51 am, "Ellin, Brian" <br...@janrain.com> wrote:
> You have a dollar sign '$' in your action_links parameter string.  I think
> that's it.
>
> On Thu, Sep 10, 2009 at 11:57 PM, Apurba <apurbahazra....@gmail.com> wrote:
> > anycan can help me? its very urgent
>
> > On Sep 7, 4:39 pm, Apurba <apurbahazra....@gmail.com> wrote:
> > > Hi Everybody,
>
> > > I have use RPX in my forum(Vbulletin).In that forum when any user
> > > register.post or reply then it will be displayed in facebook wall. The
> > > only problem is in action links. I use that code.
>
> > $api_key='fgfgfgfgfgf12121211';
> > > $action_links = array('text' => 'Recaption this', 'href' => 'http://
> > > mine.icanhascheezburger.com/default.aspx?tiid=1192742&recap=1#step2'<http://mine.icanhascheezburger.com/default.aspx?tiid=1192742&recap=1#...>

Ellin, Brian

unread,
Sep 14, 2009, 1:43:04 PM9/14/09
to rpx-dev...@googlegroups.com
Can you provide the error response you are getting when making this call?  That would be very helpful.

Ellin, Brian

unread,
Sep 14, 2009, 1:55:33 PM9/14/09
to rpx-dev...@googlegroups.com
Oh, you need to wrap your action_links in another array.  The structure is an array of arrays, not a single array.  See this page for more info:

http://wiki.developers.facebook.com/index.php/Action_Links

Apurba

unread,
Sep 15, 2009, 4:16:01 AM9/15/09
to RPX Developers
Hi ,
i have used that code, also wrap action_links in another array, but
it does not work.If i exclude the action links that works fine, it
post facebook wall. but including action links it is not working.
Please give me advice.

Code:->

$api_key='fgfgfgfgfgf12121211';
$action_links = array(array('text' => 'Listen to', 'href' => 'http://
couponwatch.com/'));
$post_data1 = array(
'apiKey' => $api_key,
'identifier' =>
$identifier,
'message' => ' has
replied for a new thread in Couponwatchdog.To
view it go to, '.$url
'action_links'=
On Sep 14, 10:55 pm, "Ellin, Brian" <br...@janrain.com> wrote:
> Oh, you need to wrap your action_links in another array.  The structure is
> an array of arrays, not a single array.  See this page for more info:
>
> http://wiki.developers.facebook.com/index.php/Action_Links
>
> On Mon, Sep 14, 2009 at 10:43 AM, Ellin, Brian <br...@janrain.com> wrote:
> > Can you provide the error response you are getting when making this call?
> > That would be very helpful.
>

Apurba

unread,
Sep 17, 2009, 1:32:14 AM9/17/09
to RPX Developers
hello evryone ,
any solution for this problem(facebook wall posting)? please help.

Daugherty, Jonathan

unread,
Sep 17, 2009, 1:38:15 AM9/17/09
to rpx-dev...@googlegroups.com
> i have used that code,   also wrap action_links in another array, but
> it does not work.If i exclude the action links that works fine, it
> post facebook wall. but including action links it is not working.

The action_links array needs to be JSON-encoded, as per the Facebook
API documentation:

http://wiki.developers.facebook.com/index.php/Stream.publish

Hope that helps!

--
Jonathan Daugherty
Software Engineer
JanRain, Inc.

blasthaus

unread,
Sep 20, 2009, 7:40:15 PM9/20/09
to RPX Developers
try this:

$json = new Services_JSON(SERVICES_JSON_LOOSE_TYPE);
$value = $services_json->decode($raw_json);

this syntax creates associative arrays instead of objects in decode()

-wil

Apurba

unread,
Sep 21, 2009, 10:16:48 AM9/21/09
to RPX Developers
Hi Everybody,

it is not working... actualy i am not able to pass action links
through RPX.
how it is possible????

blasthaus

unread,
Sep 21, 2009, 10:44:27 AM9/21/09
to RPX Developers
action_links'=
$action_links

should be a =>

does it work?
w

On Sep 21, 7:16 am, Apurba <apurbahazra....@gmail.com> wrote:
> Hi Everybody,
>
> it is not working... actualy i am not able to pass action links
> through RPX.
> how it is possible????
>
> On Sep 21, 4:40 am, blasthaus <blastha...@gmail.com> wrote:
>
> > try this:
>
> >         $json = new Services_JSON(SERVICES_JSON_LOOSE_TYPE);
> >         $value = $services_json->decode($raw_json);
>
> > this syntax creates associative arrays instead of objects in decode()
>
> > -wil
>
> > On Sep 16, 10:38 pm, "Daugherty, Jonathan" <cyg...@janrain.com> wrote:
>
> > > > i have used that code,   also wrapaction_linksin another array, but
> > > > it does not work.If i exclude the action links that works fine, it
> > > > post facebook wall. but including action links it is not working.
>
> > > Theaction_linksarray needs to be JSON-encoded, as per the Facebook

blasthaus

unread,
Sep 21, 2009, 11:59:12 AM9/21/09
to RPX Developers
also make sure to json_encode your action_links
something like
$action_links_array = array( 'text' => $textone, 'href' => $url);
$action_links = json_encode($action_links_array);

but i think you don't encode the entire post_data array prior to curl,
this way a json encoded array is just part of an object that gets
passed to rpx.com

let me know if that does the trick
w
Reply all
Reply to author
Forward
0 new messages