A new ruby-gem for the Giantbomb API

Avatar image for toadle
toadle

5

Forum Posts

0

Wiki Points

0

Followers

Reviews: 0

User Lists: 0

#1  Edited By toadle

Hey guys,

just to let all the ruby-coders out there know: I just released a new ruby-gem for the Giantbomb API called giant_bomb_api. You can read my announcement-post.

I know that there is already at least two gems out there, so you might ask, what this gem aims to do better?

  • Support most of the API-endpoints
  • Be ruby-ish
  • Querying by simple calls to the respective models
  • Easy to understand/mainable code
  • Fully tested

You can find it on Github or you can directly try it out by adding it to your Gemfile or do gem install giant_bomb_api.

Your feedback, comments and contribtions are totally welcome!

Avatar image for deactivated-62a0c35818923
deactivated-62a0c35818923

39

Forum Posts

0

Wiki Points

0

Followers

Reviews: 0

User Lists: 0

@toadle: Perfect timing, thanks - just about to kick off a 2nd attempt at an old project I'd started and this will help a lot.

Quick question though: can you really call "all" on the 'game' resource? When I tried this last time I'd had to do some webcrawling, pulling back up to 100 games at a time (my project needed a basic skeleton copy of the database to kick off).

Avatar image for toadle
toadle

5

Forum Posts

0

Wiki Points

0

Followers

Reviews: 0

User Lists: 0

@rhythm That will not change with this gem, cause that is a limit that the API imposes.

But you should be able to make multiple request and get the respectable info from:

response = GiantBombApi::Resource::Game.all

(byebug) response.has_more_results?

true

(byebug) response.offset

0

(byebug) response.number_of_total_results

46850

(byebug) response.limit

100

Avatar image for deactivated-62a0c35818923
deactivated-62a0c35818923

39

Forum Posts

0

Wiki Points

0

Followers

Reviews: 0

User Lists: 0

Cool, not too dissimilar to how I handled it last time. Thanks for the response :-)

Avatar image for toadle
toadle

5

Forum Posts

0

Wiki Points

0

Followers

Reviews: 0

User Lists: 0

I still would like to add a method "next_page" to the Response. This should make a new request with the next results.

But still work in progress ;-)