Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to find Facebook group id by name

I have a Facebook application, which I would like to be able to read facebook group feeds. I have a user-input feed url, that looks like this: http://www.facebook.com/groups/music.sharing/

To access the feed though, I can only use its id, like this: http://graph.facebook.com/[id of group]/feed

I cannot find anything for that in the reference, FQL doesn't allow querying by name so .. I'm stuck. Any ideas ?

Thanks!

like image 298
zrgiu Avatar asked Apr 10 '12 15:04

zrgiu


2 Answers

Its not possible right now, there are multiple open "bugs" and another stating the issue...

All the ways I have tried have failed... e.g. (below would work for pages)

fql?q=select id from profile where username='music.sharing'
like image 139
Nix Avatar answered Sep 27 '22 16:09

Nix


We are facing this same problem on our current project. It is not an elegant solution that uses the API, but for now we will be using a workaround by scraping the HTML of the group landing page. The group ID number appears four times on this page in the html via links. The most reliable way to search for the ID is to search for "cid=" as it only appears once (right now, anyway) on the page (what follows cid= is the numerical ID). You'll see what I mean when you examine the html of a group page.

If you found a more efficient solution, I'd be grateful if you shared :)

like image 40
MsPseudolus Avatar answered Sep 27 '22 16:09

MsPseudolus