{"id":15619735,"url":"https://github.com/drbragg/compound-data-drills-with-ruby","last_synced_at":"2026-06-21T17:31:45.679Z","repository":{"id":122870149,"uuid":"97651527","full_name":"DRBragg/Compound-Data-Drills-with-Ruby","owner":"DRBragg","description":"Some compound data drills for Launch Academy","archived":false,"fork":false,"pushed_at":"2017-07-18T23:10:43.000Z","size":36,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-22T04:26:57.201Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DRBragg.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-07-18T23:08:33.000Z","updated_at":"2017-07-18T23:08:37.000Z","dependencies_parsed_at":null,"dependency_job_id":"64e5a891-70ce-4f53-8a94-85a351b8141b","html_url":"https://github.com/DRBragg/Compound-Data-Drills-with-Ruby","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/DRBragg/Compound-Data-Drills-with-Ruby","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DRBragg%2FCompound-Data-Drills-with-Ruby","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DRBragg%2FCompound-Data-Drills-with-Ruby/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DRBragg%2FCompound-Data-Drills-with-Ruby/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DRBragg%2FCompound-Data-Drills-with-Ruby/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DRBragg","download_url":"https://codeload.github.com/DRBragg/Compound-Data-Drills-with-Ruby/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DRBragg%2FCompound-Data-Drills-with-Ruby/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34620358,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-21T02:00:05.568Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-03T08:41:20.277Z","updated_at":"2026-06-21T17:31:45.662Z","avatar_url":"https://github.com/DRBragg.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Instructions\n\nWe've obtained some data from the Twitter API to learn more about some\nLaunchers! Now we want to use the data to answer some questions.\n\nIn this challenge, you'll write a program in `code.rb` that traverses through\nthe compound data structure we got back from our API call to print out some data\nin a particular format and answer a series of questions.\n\nThe method `twitter_data` will return the data structure you need to use. You'll\nlearn even more about methods soon, but for now, know that calling `twitter_data`\nwill give you the whole structure to work with (i.e.\n`twitter_data.each do |something|`, etc).\n\n\n### Getting Set Up\n\n```\n$ cd ~/challenges\n$ et get twitter-data\n$ cd twitter-data\n```\n\n## Meeting Expectations Requirements\n\nWrite code to produce the terminal output shown in each example block. (Put\nanother way, when you run `ruby code.rb`, your program should display all of\nthis data sequentially in your terminal as shown in the example output blocks.)\n\n1. Each username followed by its description. If there is no description (i.e.,\n    `nil` then print out \"NA\" instead):\n\n    Example Output:\n\n    ```no-highlight\n    LaunchAcademy: A 10 week, intensive bootcamp teaching you how to code with a\n    focus on Ruby on Rails\n    dpickett: Co-Founder at @LaunchAcademy, Co-Organizer of @bostonrb\n    .\n    .\n    .\n    ```\n\n2. Each username followed by total number of followers.\n\n    Example Output:\n\n    ```no-highlight\n    LaunchAcademy: 3590\n    dpickett: 1604\n    .\n    .\n    .\n    ```\n\n3. Each username and the length of their latest tweet.\n\n    Example Output:\n\n    ```no-highlight\n    LaunchAcademy's latest tweet was 140 characters long.\n    dpickett's latest tweet was 81 characters long.\n    .\n    .\n    .\n    ```\n\n4. Each username followed by the total character count used in that user's last\n    twenty tweets.\n\n    Example Output:\n\n    ```no-highlight\n    LaunchAcademy used 2430 characters in their last twenty tweets.\n    dpickett used 2147 characters in their last twenty tweets.\n    .\n    .\n    .\n    ```\n\n5. Write Ruby code to answer each of the following questions about our Twitter\n    data.\n\n    As in the previous examples, display the answer to these questions in the\n    terminal.\n\n    * Which user has the most followers?\n    * Which user has the most friends?\n    * Which user has the greatest number of tweets?\n    * Which users have a `description` listed in `twitter_data`?\n    * Which users have a `location` listed in `twitter_data`?\n\n### Sample Usage\n\n* What are the twitter usernames in `twitter_data`?\n\n```ruby\ntwitter_data.each do |hash|\n  puts hash.keys.first\nend\n```\n\n### Sample Output\n\n```no-highlight\nLaunchAcademy\ndpickett\nSTWatkins78\nchrisccerami\nspencercdixon\ncorinnebabbles\ndot_the_speck\nbostonrb\njudngu\nlizvdk\nhchood\nwand_chris\njulissaJM\nashleytbasinger\nalacritythief\n```\n\n### Tips\n\n* Break down the compound data structure into its smallest parts. Isolate a data\n  structure and ask yourself what composes it. Is it an array of hashes? An\n  array of strings? An array of arrays?\n\n* Reference the Ruby docs for\n  [Arrays](http://www.ruby-doc.org/core-2.2.0/Array.html),\n  [Hashes](http://www.ruby-doc.org/core-2.2.0/Hash.html) and\n  [Strings](http://www.ruby-doc.org/core-2.2.0/String.html)\n  to explore what methods Ruby has to offer.\n\n* Use `.each`. Use it a lot.\n\n\n### Hint\n\nLet's take a look at how you might parse through some of the data structure by\nlooking at one of the hashes in `twitter_data`:\n\n```ruby\nhash =\n{\"LaunchAcademy\"=\u003e\n   {\"description\"=\u003e\n     \"A 10 week, intensive bootcamp teaching you how to code with a focus on Ruby on Rails\",\n    \"last twenty tweets\"=\u003e\n     [\"RT @chrisccerami: While learning web development I created a map of all of the shows @Screamales have played and damn @DonGiovanniRecs http…\",\n      \"6 ways to quantify your code and why you need to do it: http://t.co/1WKtpo41tP by @kevinrcasey http://t.co/lulzPLTY8c\",\n      \"Do more of what you want at work. How to create productive partnerships: http://t.co/QpYpHhHEid by @benvoss\",\n      \"RT @Pistachio: SO rad. bunch of local women learning to code with @gdiBoston at @HubSpot right now: http://t.co/jaIxK7suOj\",\n      \"RT @STWatkins78: Huge breakthrough on my breakable toy today...can upload local file to soundcloud from my app...time for a beer! #LaunchAc…\",\n      \"Just say yes to opportunities, especially if they scare you. http://t.co/LcF2ilwKDu great advice by @kerry_benjamin1\",\n      \"How the internet is changing software and business, using Ruby as an example: http://t.co/EMYeLa0se7 by  @ukitazume http://t.co/wNymPXcvAr\",\n      \"RT @chrisccerami: @JustusEapen @LaunchAcademy @MarsCuriosity https://t.co/W6IBpIuIr0\",\n      \"Come build some interesting projects! @womenwhocode Hack Night tomorrow. RSVP: http://t.co/wPgaQfQjVp http://t.co/sI5lIn9bJ9\",\n      \"RT @SpencerCDixon: One of the greatest parts of being a developer is the massive amount of control you have over a computer. Feels very emp…\",\n      \"7 reasons to love Minitest for testing Ruby code: http://t.co/Qbq5Wtb3RC by @FluxusFrequency, a graduate from our friends @gschool\",\n      \"Interested in becoming a game developer? Here's how: http://t.co/xDJDzzFxA8 via @skilledup http://t.co/ir4GphhU3m\",\n      \"Web developer hiring trends, and what they mean for you: http://t.co/0Ajg7TdQFm by @walesmd http://t.co/coRokF42kA\",\n      \"RT @chrisccerami: I recently built my first API in Rails which I hope makes photos from Mars courtesy of @MarsCuriosity more accessible to …\",\n      \"Build things that last. Make sure your work lives beyond you. http://t.co/YMbuOwhY36 by @acolangelo\",\n      \"Thanks to everyone who came to Ship It! Saturday! Check out the latest blog post for a recap: http://t.co/EYSeUc87qQ http://t.co/pAG5x0GzTa\",\n      \"Write your code as if your best friend's inheriting it http://t.co/kbtLURrPcN by @MGraybosch http://t.co/JesBAjwIiB\",\n      \"Coding can improve the way we run the world. Old, but inspiring TED talk by @pahlkadot: http://t.co/mu7QqTZK6L http://t.co/Qol943YcX3\",\n      \"Practicing pitches and getting ready for Career Day, coming up on January 27th and 28th! http://t.co/fxCcFIIMTc\",\n      \"RT @lizvdk: The cool kids use GEOjson so I did too. Here's how I build it with Ruby: https://t.co/sXFTW9nzWb\"],\n    \"number of followers\"=\u003e3590,\n    \"number of friends\"=\u003e699,\n    \"latest tweet\"=\u003e\n     \"RT @chrisccerami: While learning web development I created a map of all of the shows @Screamales have played and damn @DonGiovanniRecs http…\",\n    \"number of tweets\"=\u003e1433,\n    \"location\"=\u003e\"Boston, MA\"}}\n```\n\nHow would I find the description of `LaunchAcademy` in `hash`? First, I want to\nisolate `LaunchAcademy`:\n\n```ruby\nhash[\"LaunchAcademy\"]\n=\u003e {\"description\"=\u003e\"A 10 week, intensive bootcamp teaching you how to code with a focus on Ruby on Rails\",\n \"last twenty tweets\"=\u003e\n  [\"RT @chrisccerami: While learning web development I created a map of all of the shows @Screamales have played and damn @DonGiovanniRecs http…\",\n   \"6 ways to quantify your code and why you need to do it: http://t.co/1WKtpo41tP by @kevinrcasey http://t.co/lulzPLTY8c\",\n   \"Do more of what you want at work. How to create productive partnerships: http://t.co/QpYpHhHEid by @benvoss\",\n   \"RT @Pistachio: SO rad. bunch of local women learning to code with @gdiBoston at @HubSpot right now: http://t.co/jaIxK7suOj\",\n   \"RT @STWatkins78: Huge breakthrough on my breakable toy today...can upload local file to soundcloud from my app...time for a beer! #LaunchAc…\",\n   \"Just say yes to opportunities, especially if they scare you. http://t.co/LcF2ilwKDu great advice by @kerry_benjamin1\",\n   \"How the internet is changing software and business, using Ruby as an example: http://t.co/EMYeLa0se7 by  @ukitazume http://t.co/wNymPXcvAr\",\n   \"RT @chrisccerami: @JustusEapen @LaunchAcademy @MarsCuriosity https://t.co/W6IBpIuIr0\",\n   \"Come build some interesting projects! @womenwhocode Hack Night tomorrow. RSVP: http://t.co/wPgaQfQjVp http://t.co/sI5lIn9bJ9\",\n   \"RT @SpencerCDixon: One of the greatest parts of being a developer is the massive amount of control you have over a computer. Feels very emp…\",\n   \"7 reasons to love Minitest for testing Ruby code: http://t.co/Qbq5Wtb3RC by @FluxusFrequency, a graduate from our friends @gschool\",\n   \"Interested in becoming a game developer? Here's how: http://t.co/xDJDzzFxA8 via @skilledup http://t.co/ir4GphhU3m\",\n   \"Web developer hiring trends, and what they mean for you: http://t.co/0Ajg7TdQFm by @walesmd http://t.co/coRokF42kA\",\n   \"RT @chrisccerami: I recently built my first API in Rails which I hope makes photos from Mars courtesy of @MarsCuriosity more accessible to …\",\n   \"Build things that last. Make sure your work lives beyond you. http://t.co/YMbuOwhY36 by @acolangelo\",\n   \"Thanks to everyone who came to Ship It! Saturday! Check out the latest blog post for a recap: http://t.co/EYSeUc87qQ http://t.co/pAG5x0GzTa\",\n   \"Write your code as if your best friend's inheriting it http://t.co/kbtLURrPcN by @MGraybosch http://t.co/JesBAjwIiB\",\n   \"Coding can improve the way we run the world. Old, but inspiring TED talk by @pahlkadot: http://t.co/mu7QqTZK6L http://t.co/Qol943YcX3\",\n   \"Practicing pitches and getting ready for Career Day, coming up on January 27th and 28th! http://t.co/fxCcFIIMTc\",\n   \"RT @lizvdk: The cool kids use GEOjson so I did too. Here's how I build it with Ruby: https://t.co/sXFTW9nzWb\"],\n \"number of followers\"=\u003e3590,\n \"number of friends\"=\u003e699,\n \"latest tweet\"=\u003e\"RT @chrisccerami: While learning web development I created a map of all of the shows @Screamales have played and damn @DonGiovanniRecs http…\",\n \"number of tweets\"=\u003e1433,\n \"location\"=\u003e\"Boston, MA\"}\n ```\n\nI can then isolate `description` further to get the description as follows:\n\n```ruby\nhash[\"LaunchAcademy\"][\"description\"]\n=\u003e \"A 10 week, intensive bootcamp teaching you how to code with a focus on Ruby on Rails\"\n```\n\nIf that's how I find the description, how do I find the number of followers of `LaunchAcademy`?\n\n```ruby\nhash[\"LaunchAcademy\"][\"number of followers\"]\n=\u003e 3590\n```\n\nWhat about the number of tweets?\n\n```ruby\nhash[\"LaunchAcademy\"][\"number of tweets\"]\n=\u003e 1433\n```\n\nSee the pattern? Isolate what you need by isolating what's around it. Breaking\nup problems is the golden standard of a good programmer! (Use the force!)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrbragg%2Fcompound-data-drills-with-ruby","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdrbragg%2Fcompound-data-drills-with-ruby","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrbragg%2Fcompound-data-drills-with-ruby/lists"}