Join GitHub today
Add Behance Importer #46
— I'm really new to Ruby so, thank in advance for your indulgence —
I've built a little importer draft that works with Behance's API. It imports all projects from a specific user and create new post entries for each project. For now, it's pretty straightforward : all the meta datas returned by the API are stored in the post variable named "project", all of them, as delivered.
So, before going any further, I'd like to have some feedback from you guys.
I'm pretty sure it could be better if the project modules are printed in the post content (instead of relying on the metadatas) and if images are stored locally.
Any help and feedback is welcome.
The metadata is nice because it allows more flexibility in styling. If you output modules, it would be a lot harder for me to make my tweaks. I think adding the fields as metadata and maybe a description or something as content, then you're on the right track with Jekyll.
Nah, this is perfect.
We merge everything into the main branch here and deploy that to RubyGems.org.
As long as it's never anyone else's work (without the consent/attribution of the other owner) then you should be OK.
@parkr thanks for your encouraging feedback. Here my updated code, raked and tested in a real jekyll environment. Works great, I should maybe make sure all the metadatas are usable, but I guess
I'am just not sure about importing assets (at least images) in a local folder, but this would go against the API that serve full URL, and this involve rewriting URL in modules, which I think is not a very good idea. What do you think ?
@parkr of course, but I have several questions. Is it a good practice to test the return of an API? If so, how can I test it without providing an API key in the test files?
@rayfranco Sorry for the ridiculously long delay! It's not generally good practice to test the API directly, but to test with mock data. That is, you should be able to override your method which accesses the API and send back mock data so you know what to expect.
What do you mean, "test jekyll-import output"?