abjerner / Skybrud.Social

Skybrud.Social is a framework in .NET for integration with various social services like Twitter, Facebook and Instagram. The framework will handle all the technical parts and API communication so you don't have to.
http://social.skybrud.dk/
MIT License
96 stars 32 forks source link

Facebook Page Cover Image batch request #77

Closed rahulbachina closed 5 years ago

rahulbachina commented 6 years ago

Hi, First of all then you very much for this Great Library I have a CSV with Facebook Page Ids and Now I want to Grab the Cover Image for the Pages using page Id

I can able to do that but for 1 by 1 Page id using the Below code // Initialize the service from the access token FacebookService service = FacebookService.CreateFromAccessToken(accessToken); FacebookGetPageOptions pageoptions = new FacebookGetPageOptions(); pageoptions.Identifier = pageID; pageoptions.Fields = fieldsforpage; //Skybrud.Social.Facebook.Objects.Pages.FacebookPage pages = service.Pages.GetPage(skybrud);

        // Make the request to the API
        FacebookPageResponse response = service.Pages.GetPage(pageoptions);

        Skybrud.Social.Facebook.Objects.Pages.FacebookPage page1 = response.Body;

        var page = response.Body;

        if (page.Cover != null)
        {
            string cover = page.Cover.Source.ToString();
            if (cover != null)
            {
                return cover;
            }
            else
            {
                return string.Empty;
            }
        }
        else
        {
            return null;
        }

I wonder is there any way I can send all the ids at once to get the Cover Images to that Pages in a Batch request

Could you please let me know how can I do a Batch request to Facebook to get all the Cover Images.

Thanks in Advance, Rahul

abjerner commented 6 years ago

Hi Rahul,

This package doesn't support batch requests.

I actually didn't know Facebook supported batch requests, so this is not supported in my package. It probably should be supported at some point - but for now it isn't.

abjerner commented 5 years ago

Closing due to inactivity.