Wednesday, April 17, 2013

Learning Ruby on Rails Day 176 = APIs

How hard could it be to talk to another website and get some information? Actually fairly hard and at least for me slightly complicated :-) My friend Peter who's site I'm making wants to be able to upload photos of recent work he's done right from his phone, while he's out working.

I have failed on that front, I tried using a Facebook embedded link but you still have to log in and make a badge for each photo, and the badge looks really ugly up on the site. I tried Flickr, but again you have to make a little Flickr image and paste the code  into the views file.

Instagram looked promising and I registered the Landscaping site with their API, but I am sadly lost on all the functions and features of the API.  So I've decided to use the 'Devise' and 'Carrierwave' gems, so that Peter can log in and upload any image from his computer fairly easily.

That's not uploading from his phone but he will at least have the functionality to upload new images on his own. As I get better at this whole Ruby on Rails thing, I'll go back in and probably use Instagram to upload his photos.

On the positive front, I am so impressed with how easy 'Devise' makes authorization, I have used it a little on another project, but I really didn't "get it" but now I really appreciate a lot more of the magic that it does.

I spent 4 hours studying/learning today with not a lot of website progress to show for it, but I did get my feet wet learning a little about how APIs work, I really want to understand how to use APIs more, and not just the main ones like Facebook, Twitter, and stuff.

A shout out of thanks to +Isaac Cambron for helping me and giving me tips to understand APIs better, the man's a genius, check out some of his stuff:

I just want to say, how impressed  I've been by the whole coding community and especially the Ruby on Rails crowd,  I haven't recieved anything but support and kindness from the very start of learning to code and for that I am very grateful.

 Okay back to my sad website :-)  Josh