It’s end of the week again so we review the code challenge of this week: Query Your Favorite API. It’s never late to join, just fork us and start coding.
PyBites
Julian
As I discussed in my post this week about learning Python, this code challenge was pretty much directed at me.
Going into this one, I’d never accessed an API in my life!
I spent the entire week playing around with different APIs but primarily the World of Warcraft and Gmail APIs.
The work with the Gmail API was great learning but essentially a bust when it came to having a working script. I had an idea in mind as to what I wanted from it but I just wasn’t able to get it done.
I did have a little more success with the World of Warcraft API however. I’m sure it means nothing to most of you reading this but I was able to pull down data about my player character and have it presented in a readable format. (JSON was also new to me!).
The code for this is here. As it was my first API attempt, it is definitely quite simplistic. The intention is to wrap it all up such that I can recreate my character profile locally.
Bob
I used various APIs this week:
-
I combined the Twitter and Slack API in my article of this week: How to Write a Simple Slack Bot to Monitor Your Brand on Twitter.
-
For our 100 days challenge I created an interactive script to query the OMDb API.
-
For the challenge I really wanted to make a start migrating fbreadinglist from PHP to Python. As it uses the Google Books API it was a good fit for this challenge. I completed the autocomplete feature using the same JS, but Python/Flask for the back-end:
When you select a title it redirects to a page where it pulls more details from the Google Books API (buttons not yet implemented):
Community
We got 2 cool Pull Requests. We are really stoked you submit code to our repo. Good work folks, keep up the momentum!
Clamytoe
Martin submitted a cool project called GitHub-Profiler where he queries the Github API for a given user, entering ‘pybites’ it generates this nice page, awesome:
If bio and repos was not enough, scrolling towards the end it also lists gists:
Code merged on our community branch.
Dseptem
Another usage of APIs we got from Dante who used the Forismatic API to pull random quotes. The author’s bio gets crawled from Wikipedia, really nice:
When you hit “Another Quote!” the page refreshes and shows another random quote and its author + bio:
Code merged on our community branch.
We hope you are enjoying these challenges, learning along the way. Let us know if you have any issue and/or contact us if you want to submit a cool challenge. See you next week …
Keep Calm and Code in Python!
— Bob and Julian