Closed ncot-tech closed 7 years ago
Yep, there's no reason why you couldn't do that. In step 4, you'd just want to make sure that you're using Keyring's request()
method so that you're getting the authentication handled etc. You can use that via $this->service->request()
within an importer.
Just be aware that making a lot of external requests will slow things down, and eventually potentially max out the memory available on your server.
I'm trying to modify the Facebook Importer found elsewhere on Github to work a bit nicer (but this isn't about the Facebook importer specifically...)
Facebook's API is quite complex in that you can say "give me all my posts" and it'll give just the text and the ID of that post in nicely formatted JSON. To get any more information about each post (attached images, links, people you've mentioned, thumbnails of linked sites, etc), you make further HTTP requests to Facebook, giving it the post ID you're interested in and the data you want.
So the routine would go something like this
Is there a way to do step 4 from within the importer, or will I need to do something else? I can't see any mechanism from within the importer to do any actual HTTP requests... I'm guessing that's done elsewhere?