addressalign-toparrow-leftarrow-rightbackbellblockcalendarcameraccwcheckchevron-downchevron-leftchevron-rightchevron-small-downchevron-small-leftchevron-small-rightchevron-small-upchevron-upcircle-with-checkcircle-with-crosscircle-with-pluscrossdots-three-verticaleditemptyheartexporteye-with-lineeyefacebookfolderfullheartglobegmailgooglegroupsimageimagesinstagramlinklocation-pinm-swarmSearchmailmessagesminusmoremuplabelShape 3 + Rectangle 1outlookpersonStartprice-ribbonImported LayersImported LayersImported Layersshieldstartickettrashtriangle-downtriangle-uptwitteruseryahoo

Chicago Ruby Hack Night - JSON

  • Jun 12, 2013 · 6:30 PM

Come on out and hack!

A lot of data is transferred in JSON format which is easy for programs to read but hard for humans since it's all one line.  Let's solve this problem with a Ruby program that formats JSON so that we can read it easily.  This problem has been solved before, of course, but not by you so it's a good exercise.

Sample JSON data is shown below.  Check JSON Lint for an example of an app that solves this problem.  If you get the formatting done early you can also try validating the JSON, too.

We'll pair up to work on this Ruby problem. All Rubyists are welcome, including beginners. Bring your laptop with ruby installed.

Enova Financial, our hosts, will provide food and drink.

 

Sample JSON from JSON Generator:

{"id":1,"jsonrpc":"2.0","total":7,"result":[{"id":1,"guid":"37921d7f-7cc2-46ab-81ea-c54ae9a6bdef","isActive":false,"balance":"$2,604.00","picture":"http://placehold.it/32x32","age":40,"name":"Sydney Harrison","company":"Quintegrity","phone":"[masked]","email":"[masked]","address":"38275, Garland, Broome Streets","about":"Magna cillum ipsum ipsum esse et officia magna quis cillum proident. Laborum Lorem enim non qui esse. Tempor veniam do nisi officia consequat duis adipisicing qui occaecat non. Non consectetur dolor adipisicing Lorem exercitation sit reprehenderit consectetur ut est ad. Irure aliquip magna veniam Lorem velit.\r\n","registered":"[masked]T03:09:03 +05:00","latitude":30,"tags":["elit","aliquip","anim","minim","quis","incididunt","voluptate"],"friends":[{"id":1,"name":"Zoey Crossman"},{"id":2,"name":"Claire Hoggarth"},{"id":3,"name":"Savannah Charlson"}],"gender":"female","randomArrayItem":"teacher"},{"id":2,"guid":"0227f[masked]c-4e92-8dec-81057b992029","isActive":true,"balance":"$3,686.00","picture":"http://placehold.it/32x32","age":29,"name":"Alexis Crossman","company":"Nanobanc","phone":"[masked]","email":"[masked]","address":"22640, Escondido, Walker Street","about":"Enim deserunt velit ad quis. Duis reprehenderit id amet anim commodo voluptate ad. Velit labore dolor et nulla laboris velit laboris consectetur amet deserunt.\r\n","registered":"[masked]T00:47:19 +05:00","latitude":61,"tags":["mollit","anim","cillum","duis","enim","consequat","non"],"friends":[{"id":1,"name":"Allison Hamphrey"},{"id":2,"name":"Ava Webster"},{"id":3,"name":"Emma Vaughan"}],"gender":"male","randomArrayItem":"teacher"},{"id":3,"guid":"2a8685a8-97d1-47e4-b75c-486b0b6c3fc5","isActive":true,"balance":"$3,313.00","picture":"http://placehold.it/32x32","age":35,"name":"Lillian Watson","company":"US Omnigraphik","phone":"[masked]","email":"lillian@us omnigraphik.com","address":"20753, Cambridge, Lafayette Street","about":"Ea mollit mollit laboris deserunt. Ut amet ullamco sit aute quis. Tempor labore ex commodo ex enim ea adipisicing esse ad cillum. Nulla cillum ut ullamco veniam duis id pariatur reprehenderit est est laboris mollit consequat. Esse aliqua Lorem deserunt Lorem id reprehenderit incididunt sit adipisicing tempor pariatur ipsum laborum irure. Labore irure consequat irure magna nisi reprehenderit eu est ea enim proident cupidatat. Ut aliquip id ea dolore dolore fugiat aute in sunt consectetur.\r\n","registered":"[masked]T14:42:32 +05:00","latitude":-23,"tags":["reprehenderit","consectetur","enim","sint","ea","sint","laboris"],"friends":[{"id":1,"name":"Andrea Oliver"},{"id":2,"name":"Allison Gilbert"},{"id":3,"name":"Madeline Ward"}],"gender":"female","randomArrayItem":"student"},{"id":4,"guid":"9e6193e7-077a-4c08-b1c3-d356226e96d1","isActive":true,"balance":"$2,770.00","picture":"http://placehold.it/32x32","age":40,"name":"Payton Day","company":"Conotomics","phone":"[masked]","email":"[masked]","address":"22271, Elgin, Crosby Streets","about":"Proident ullamco adipisicing consequat laborum ipsum in voluptate proident sint. Magna ea consequat sit elit labore aliquip. Laborum irure fugiat id et aliquip incididunt. Anim laborum proident proident ea sit culpa esse sunt cillum reprehenderit consectetur. Veniam amet dolore dolore elit exercitation enim elit nisi irure ad dolor. Aliqua ad dolore aute adipisicing irure laborum pariatur ipsum esse commodo sint consequat occaecat eu. Cillum elit esse occaecat cupidatat consectetur mollit dolore aute sint sint nulla incididunt.\r\n","registered":"[masked]T00:15:29 +05:00","latitude":0,"tags":["nisi","incididunt","veniam","aute","duis","laborum","labore"],"friends":[{"id":1,"name":"Jessica Freeman"},{"id":2,"name":"Rachel Campbell"},{"id":3,"name":"Abigail Crossman"}],"gender":"female","randomArrayItem":"teacher"},{"id":5,"guid":"e6950ea7-28f4-45fc-aba2-98b8e8a59af4","isActive":false,"balance":"$1,534.00","picture":"http://placehold.it/32x32","age":31,"name":"Gabriella Davidson","company":"Anagraph","phone":"[masked]","email":"[masked]","address":"13209, Chattanooga,  nr 43rd Street","about":"Dolore magna proident dolore ut nisi veniam. Est officia do ea cillum ipsum dolore incididunt deserunt sint excepteur proident. Veniam mollit amet commodo Lorem amet magna ea excepteur Lorem.\r\n","registered":"[masked]T11:57:24 +06:00","latitude":-40,"tags":["ad","qui","deserunt","cupidatat","ea","aute","consectetur"],"friends":[{"id":1,"name":"Madelyn Miln"},{"id":2,"name":"Hailey Hancock"},{"id":3,"name":"Katherine Daniels"}],"gender":"male","randomArrayItem":"student"},{"id":6,"guid":"75d79c47-de81-4b27-ad18-59cf422153e0","isActive":true,"balance":"$3,979.00","picture":"http://placehold.it/32x32","age":31,"name":"Jocelyn Higgins","company":"Airdyne","phone":"[masked]","email":"[masked]","address":"13246, Boise, Water Street","about":"Exercitation proident sint sit officia dolore esse amet laboris. Dolor dolore laboris reprehenderit ea enim voluptate proident veniam esse occaecat esse laboris laborum eu. Aute deserunt aliqua cillum officia sit anim laboris deserunt.\r\n","registered":"[masked]T13:09:18 +05:00","latitude":66,"tags":["laboris","nostrud","cillum","et","pariatur","sint","dolor"],"friends":[{"id":1,"name":"Morgan Smith"},{"id":2,"name":"Sophia Gustman"},{"id":3,"name":"Jasmine Freeman"}],"gender":"male","randomArrayItem":"student"},{"id":7,"guid":"eab[masked]d17-41fe-b346-d8c52a29556a","isActive":true,"balance":"$2,368.00","picture":"http://placehold.it/32x32","age":30,"name":"Addison Bush","company":"Robotomic","phone":"[masked]","email":"[masked]","address":"11750, BatonRouge, Duane Streets","about":"Lorem elit esse voluptate ullamco sit. Anim sunt esse duis aliquip consequat veniam Lorem ea eiusmod dolor. Ut voluptate culpa velit quis in cupidatat nisi eiusmod incididunt. Tempor tempor id minim nostrud eiusmod esse. Qui et nisi ullamco ipsum dolore reprehenderit incididunt consequat cillum sit. Velit ex ut irure anim dolore irure minim Lorem. Ullamco laborum deserunt voluptate id quis esse.\r\n","registered":"[masked]T17:56:01 +06:00","latitude":-67,"tags":["commodo","fugiat","tempor","esse","nostrud","esse","sunt"],"friends":[{"id":1,"name":"Audrey Chesterton"},{"id":2,"name":"Hannah Gilbert"},{"id":3,"name":"Samantha Smith"}],"gender":"female","randomArrayItem":"student"}]}

 

Join or login to comment.

  • Jason A.

    Great time meeting everyone last night!

    If you're interested, we still have about 8 seats available for next Tue's RECSOLU poker event. Contact me for free ticket info.

    June 13, 2013

  • Ginny H.

    If you left your MBP power cord in the meeting room, I have it. Email me gh <at> ghendry <dot> com to claim it.

    June 12, 2013

  • Frank B.

    Anybody care to post their solution to git? I'm curious to see what other people came up with.

    June 12, 2013

  • Frank B.

    Good stuff! I had a lot of fun.

    June 12, 2013

  • A former member
    A former member

    Hi All!

    Just curious -- is the event still on -- I'm wondering because of the upcoming storm :)

    June 12, 2013

    • A former member
      A former member

      ditto, was looking forward to coming but might also depend on how bad it is

      1 · June 12, 2013

    • Josh C.

      Yeah, it's occurring, they're unloading drinks right now.

      June 12, 2013

  • Andrew L.

    Long day deep in data. I have a brain block occurring, I need to take a break!

    June 12, 2013

  • Alex G.

    Guest Name: Scott Lessans

    June 11, 2013

  • Aaron F.

    We are excited to be here!!!

    June 6, 2013

  • Andrew L.

    Noob!

    June 3, 2013

  • Andrew L.

    I'm new to the group and new to Ruby!

    June 3, 2013

Our Sponsors

  • WindyCityThings

    June 23-24, 2016. Master the Internet of Things & make IoT work for you.

  • WindyCityRails

    Sept 15-16, 2016. Learn to tackle big league problems at WindyCityRails.

  • WisdomGroup

    Contributes to open source through ChicagoRuby.

People in this
Meetup are also in:

Sign up

Meetup members, Log in

By clicking "Sign up" or "Sign up using Facebook", you confirm that you accept our Terms of Service & Privacy Policy