{"id":24883256,"url":"https://github.com/ajm188/cwru_directory","last_synced_at":"2025-08-15T22:10:04.154Z","repository":{"id":28915485,"uuid":"32440469","full_name":"ajm188/cwru_directory","owner":"ajm188","description":"Query CWRU directory listing in Ruby","archived":false,"fork":false,"pushed_at":"2015-03-18T05:49:08.000Z","size":124,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-01T13:48:40.101Z","etag":null,"topics":["cwru","ruby"],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ajm188.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-03-18T05:48:27.000Z","updated_at":"2015-03-18T05:49:00.000Z","dependencies_parsed_at":"2022-08-03T06:15:54.700Z","dependency_job_id":null,"html_url":"https://github.com/ajm188/cwru_directory","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ajm188%2Fcwru_directory","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ajm188%2Fcwru_directory/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ajm188%2Fcwru_directory/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ajm188%2Fcwru_directory/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ajm188","download_url":"https://codeload.github.com/ajm188/cwru_directory/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245814749,"owners_count":20676808,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["cwru","ruby"],"created_at":"2025-02-01T13:48:42.723Z","updated_at":"2025-03-27T09:16:13.850Z","avatar_url":"https://github.com/ajm188.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CWRUDirectory\n\nMake queries with the Case Western Reserve University [directory listing](https://webapps.case.edu/directory/index.html) in Ruby!\n\nInspired by/derived from [the Python implementation](https://github.com/brenns10/caseid).\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'cwru_directory'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install cwru_directory\n\n## Usage\n\n### Configuration\n\nCWRUDirectory currently recognizes the following configuration options\n(you can set as many other options as you like, they just won't do anything):\n\n```ruby\nCWRUDirectory.configure do |config|\n  # case_id and password are used to authenticate with SSO to\n  # be able to access information not available to the public\n  config.case_id = 'abc123'\n  config.password = 'my-password'\n\n  # get_all_info is used to tell CWRUDirectory to actually get\n  # that extra info not available to the public\n  config.get_all_info = true\nend\n```\n\n### Queries\n\nCWRUDirectory has two ways to query the directory, simple and advanced.\nBoth return a hash, which maps the categories to the sets of results for\neach category.\n\n#### The Result hash\n\nAs mentioned above, each element of a result set is a hash, which has the following keys:\n  * `:name`\n  * `:phone_number`\n  * `:email`\n  * `:department`\n\nIf you run this with the `get_all_info` config option set, you will also\nget some of the following, possibly more:\n  * `\"Case Network ID\"` - this one is always present (as far as I can tell)\n  * `\"Title\"` \n  * `\"Mail Stop Location Code\"` - uhhh. I guess if you need that...\n\n#### Simple Queries\n\nSimple queries allow you to search by single search string in a given search mode.\n\n```ruby\nCWRUDirectory.simple 'my_search_string'\n# second argument is the search mode, defaults to :regular,\n# :phonetic is the only other option the Case directory supports\nCWRUDirectory.simple 'my_search_string', :phonetic\n```\n\n#### Advanced Queries\n\nYou can also make \"advanced\" queries with many more attributes. The Case directory has the\nfollowing attributes:\n  * `surname` - last name\n  * `givenname` - first name\n  * `department` - this isn't listed for most entries, so probably won't be that helpful to you\n  * `location` - ??? if you figure out what this actually is, let me know\n  * `category` - one of `'STUDENT', 'FACULTY', 'STAFF', 'EMERITI', 'ALL'`\n  * `search_text` - this is the same as the search text used in the simple queries\n  * `search_method` - same as simple queries\n\nJust pass in a hash of whichever ones you want to use; the rest will default to empty strings,\nexcept for `category` (default is `'ALL'`) and `search_method` (defaults to `:regular`)\n\n```ruby\nCWRUDirectory.advanced({surname: 'Mason', givenname: 'Andrew'})\n```\n\nThat's all for now folks! LDAP probably coming soon.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fajm188%2Fcwru_directory","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fajm188%2Fcwru_directory","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fajm188%2Fcwru_directory/lists"}