Jump to content

Sync posts from a Facebook group to my shopping website.

Hello, I have got a small facebook classifieds group with about a hundred users regularly posting items for sale. It has reached some popularity among the locals and it is quite active now. All kinds of items are posted in it and its a bit messy now as the only way to sort the items would be through the keywords you enter in the search. So I had a thought to make a shopping website for having a more organized representation of the items in this group by separating them to different categories. I want the items to be fetched and displayed directly from facebook to my website so I do not have to store them with me and they will be taken out when the publisher deletes it from facebook. I have not attempted something like this before, so im not sure where I should start. I had a look into Facebook's developer tools Graph API. The documentation didnt explain anything on how to go inside a group and search for items. It only shows how to search for group names. Found this other third party API called Facebook4J and that also shows similar examples to that of Graph API. I also saw other options like using an RSS to grab the information but then again I saw comments on them that they do not work anymore as Facebook has changed their policy. What do u think is the best way to achieve this process? Your suggestions would be very helpful. Thanks.

Link to comment
Share on other sites

Link to post
Share on other sites

3 hours ago, Shammikit said:

The documentation didnt explain anything on how to go inside a group and search for items

you can get posts from a group with  https://developers.facebook.com/docs/graph-api/reference/v6.0/group/feed

 

/* make the API call */
FB.api(
    "/{group-id}/feed",
    function (response) {
      if (response && !response.error) {
        /* handle the result */
      }
    }
);

Then you can use 

const items = response.reduce((acc, current) => {
	if(current.something.includes('box'){
    	acc.push(current)
    }
    return acc;
}, [])

though i have no idea what the items look like to help you with the searching.

                     ¸„»°'´¸„»°'´ Vorticalbox `'°«„¸`'°«„¸
`'°«„¸¸„»°'´¸„»°'´`'°«„¸Scientia Potentia est  ¸„»°'´`'°«„¸`'°«„¸¸„»°'´

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×