Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Ruby

Jeremy Frimond
Jeremy Frimond
14,470 Points

Incorporating Third Party API's with Ruby on Rails 5

Hello All,

Does anyone know of a good resource out there which teaches how to incorporate a third party API into an existing ruby application? For example, how to bring in data from open weather map API? What code goes in what file etc?

I know that Tree House has a blog on using HTTParty which I didn't really follow. Any additional resources beyond that?

Thanks!

1 Answer

Kevin Korte
Kevin Korte
28,149 Points

Not that I'm aware of, but I incorporated a weather API into a Rails 4 app only for use at my work, it sends text message alerts based on what conditions we want, and checks current weather every 7 minutes and forecasted weather every 2 hours.

Here is the git repo if you want to look through the whole project: https://github.com/kevinkorte/weather

And the meat and potatoes is here: https://github.com/kevinkorte/weather/blob/master/config/initializers/scheduler.rb

I'm sure there is a much cleaner way to do this, but I threw this together in about a day and it works fine for our needs.

Jeremy Frimond
Jeremy Frimond
14,470 Points

Thanks I was able to glean what I needed from the meat and potatoes!