Finding a user's post by post ID?

133 views
Skip to first unread message

H. Wade Minter

unread,
Jan 26, 2012, 5:04:19 PM1/26/12
to fb_g...@googlegroups.com
Is there a way, using FbGraph, to search a user's wall for a given post identifier?

I'm trying this:

me.posts.find("732615109_10150617000595110").first

But when the post isn't there (it's been deleted), it's returning me the next earliest post in the stream. I'd like there to be a way to just search for a post by the identifier, and if it's not there, return false or nil.

Does that already exist, and I'm just missing it?

Thanks,
Wade

matake@gmail

unread,
Jan 26, 2012, 6:54:57 PM1/26/12
to fb_g...@googlegroups.com
You don't need to "search" if you have identifier.
Just do below (and also handle FbGraph::NotFound exception)

FbGraph::Post.new("post_id").fetch

H. Wade Minter

unread,
Jan 26, 2012, 7:00:20 PM1/26/12
to fb_g...@googlegroups.com
That looks like what I need, but I have a series of users' access tokens, and will be trying to pull up the post (on their wall) with their read_stream permissions. How do I get that to work within the context of a specific user?

--Wade

matake@gmail

unread,
Jan 26, 2012, 7:08:10 PM1/26/12
to fb_g...@googlegroups.com
You can put access token as option hash when calling "new", "fetch" or any connection method ("feed", "albums", "checkins" etc)
So these 2 are equivalent in this case.

FbGraph::Post.new('post_id', :access_token => 'token').fetch
FbGraph::Post.new('post_id').fetch(:access_token => 'token')

H. Wade Minter

unread,
Jan 26, 2012, 7:08:59 PM1/26/12
to fb_g...@googlegroups.com
Beautiful, thanks so much!

--Wade

d8au...@gmail.com

unread,
Apr 22, 2014, 3:48:49 AM4/22/14
to fb_g...@googlegroups.com
Hi, how to find post's ID after post to group page
Thanks a lot!

nov matake

unread,
Apr 22, 2014, 3:53:00 AM4/22/14
to fb_g...@googlegroups.com
post = @page.feed!(params)
puts post.identifier

--
You received this message because you are subscribed to the Google Groups "FbGraph" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fb_graph+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

d8au...@gmail.com

unread,
Apr 22, 2014, 4:57:17 AM4/22/14
to fb_g...@googlegroups.com
Great!, It work fine with me.
Thanks a lot Nov Matake

NuDon Dinh

unread,
Apr 25, 2014, 3:26:44 AM4/25/14
to fb_g...@googlegroups.com
Hi Nov Matake 
How to join to facebook group with fb_graph?
I research it but no any result
Thank you so much!

nov matake

unread,
Apr 25, 2014, 3:27:18 AM4/25/14
to fb_g...@googlegroups.com
Is there such API?

NuDon Dinh

unread,
Apr 25, 2014, 3:46:22 AM4/25/14
to fb_g...@googlegroups.com
I don't sure, but I thinks yes.
I'm implementing a feature: user search group and after that joins to a group when user click joins (this is button) 
I don't know how to work

nov matake

unread,
Apr 25, 2014, 4:12:41 AM4/25/14
to fb_g...@googlegroups.com
How you thought yes?
Did you read any API documents??

Đinh Nữ Dôn

unread,
Apr 25, 2014, 4:29:22 AM4/25/14
to fb_g...@googlegroups.com
I read some documents in there
http://stackoverflow.com/questions/22899894/facebook-graph-api-and-facebook-groups
and I think yes.
I have tried but no success
If you know any solve, please let me know
Thanks a lot
 Đinh Nữ Dôn
 07T2 - ITBK
0983.892.102

nov matake

unread,
Apr 25, 2014, 4:31:43 AM4/25/14
to fb_g...@googlegroups.com
Ah, then probably

@user = FbGraph::User.new(user_id)
@group = FbGraph::Group.new(group_id)
@group.member!(@user, access_token: @access_token)

2014/04/25 17:29、Đinh Nữ Dôn <d8au...@gmail.com> のメール:

Đinh Nữ Dôn

unread,
Apr 25, 2014, 4:34:27 AM4/25/14
to fb_g...@googlegroups.com
Thank you very much ^^

Đinh Nữ Dôn

unread,
Apr 27, 2014, 4:55:53 AM4/27/14
to fb_g...@googlegroups.com
Hi nov matake
How to post long text to facebook
I use 
page.feed!(
        :message => "text",
      )
but not work for the case message => "long text"
Please help me. Thank you so much

Đinh Nữ Dôn

unread,
Apr 27, 2014, 5:11:58 AM4/27/14
to fb_g...@googlegroups.com
Oops, sorry. I have tried and success.
Thanks for your hepl nov matake

Đinh Nữ Dôn

unread,
Apr 27, 2014, 11:10:22 PM4/27/14
to fb_g...@googlegroups.com
Hi all.
I have issue about post photo to group page

This is my config:
  config.omniauth :facebook, "ID", "SECRET",
  {:scope => 'email, publish_actions, user_groups, user_likes, user_photos, photo_upload, publish_stream"}

This my code:
    page = FbGraph::Page.new("page_id",:access_token => access_token).fetch
   
    post = page.photo!(
        :source => photo,
        :message => message
      )

I tried with two account.
One success and one got error message:
FbGraph::Unauthorized OAuthException :: You have been temporarily blocked from performing this action.

I don't know why. I take days to fixed it, but no success.
Please help me
Thank you verify much!

Đinh Nữ Dôn

unread,
Jun 17, 2014, 3:33:12 AM6/17/14
to fb_g...@googlegroups.com
Hi nov matake
Regarding add member to group. I worked as you guide
    @user = FbGraph::User.new(user_id)
    @group = FbGraph::Group.new(group_id)
    @group.member!(@user, access_token: @access_token)

    (@user and @group are valid)

but I still get error: OAuthException :: (#3) Unknown method
in line: @group.member!(@user, access_token: @access_token)

There are a few people got the same problem like me


It took me one month to find ways to problem solving, but not success
I'm really need help.
Please help me if you have any solution
Thank you very much


nov matake

unread,
Jun 17, 2014, 3:57:19 AM6/17/14
to fb_g...@googlegroups.com
hum, it seems their API interface changed.
and there are no way to add normal users to a group anymore...

"Apps can invite people (if they are an admin, developer, or tester of the app) to a group created by that app using this edge"

Đinh Nữ Dôn

unread,
Jun 17, 2014, 4:29:57 AM6/17/14
to fb_g...@googlegroups.com
Thanks your feedback, no matake
This is big problem with me.
I need implement a ticket is: add user (any user) to a group that not created by my app (this group was create anyone)

Is it even possible?
Thanks a lot


nov matake

unread,
Jun 17, 2014, 4:36:42 AM6/17/14
to fb_g...@googlegroups.com
hum, you should ask FB developer support for such questions..

Đinh Nữ Dôn

unread,
Jun 17, 2014, 4:38:06 AM6/17/14
to fb_g...@googlegroups.com
Thank you so much.
Reply all
Reply to author
Forward
0 new messages