{"id":13718513,"url":"https://github.com/iostreamer-X/devRant-crystal","last_synced_at":"2025-05-07T10:33:01.530Z","repository":{"id":82131621,"uuid":"65659015","full_name":"iostreamer-X/devRant-crystal","owner":"iostreamer-X","description":"A crystal wrapper for devRant API","archived":false,"fork":false,"pushed_at":"2023-05-23T11:27:54.000Z","size":13,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-08-04T01:11:24.824Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Crystal","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/iostreamer-X.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2016-08-14T09:24:43.000Z","updated_at":"2023-05-23T11:27:59.000Z","dependencies_parsed_at":null,"dependency_job_id":"3d4c62bc-9c6d-42b9-b044-96ec48a0de00","html_url":"https://github.com/iostreamer-X/devRant-crystal","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iostreamer-X%2FdevRant-crystal","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iostreamer-X%2FdevRant-crystal/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iostreamer-X%2FdevRant-crystal/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iostreamer-X%2FdevRant-crystal/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iostreamer-X","download_url":"https://codeload.github.com/iostreamer-X/devRant-crystal/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224592048,"owners_count":17337029,"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":[],"created_at":"2024-08-03T01:00:30.215Z","updated_at":"2024-11-14T08:30:32.887Z","avatar_url":"https://github.com/iostreamer-X.png","language":"Crystal","funding_links":[],"categories":["Uncategorized"],"sub_categories":["Uncategorized"],"readme":"# devRant-crystal\n\nA crystal wrapper for devRant API\n\n![](https://travis-ci.org/iostreamer-X/devRant-crystal.svg?branch=master)\n\nHeavily inspired(and in a way ported) from [danillouz/devrant](https://github.com/danillouz/devrant)\n\n![I pretty much copied everything from danillouz/devrant](https://raw.githubusercontent.com/danillouz/devrant/master/img/devrant.png)\n\n## Installation\n\n\nAdd this to your application's `shard.yml`:\n\n```yaml\ndependencies:\n  devRant-crystal:\n    github: iostreamer-X/devRant-crystal\n```\n\n\n## Usage\n```crystal\nrequire \"devRant-crystal\"\nDevRant.method\n```\nEach method also has an async verion, which has 'Async' appended to the method name.\n```crystal\nDevRant.methodAsync do |arg|\n  puts arg\nend\n```\n\n\n## Methods\nAfter requiring the module, the following methods can be\nused:\n\n| METHOD | ARGUMENTS | RETURNS | DESCRIPTION |\n| --- | --- | --- | --- |\n| getIdFromUsername | Yes | `String` | Retrieve a user's id. |\n| getRantFromId | Yes | `Full Rant Object` | Retrieve a single rant from devRant. Use this method to retrieve a rant with its full text and comments. The retrieved rant is a [Full Rant Object](#rant-object-full). |\n| getRants | Optional | `Array[Simple Rant Objects]` | Retrieve rants from devRant. The retrieved rants are [Simple Rant Objects](#rant-object-simple). |\n| search | Yes | `Array[Simple Rant Objects]` | Retrieve rants from devRant that match a specific search term. The retrieved rants are [Simple Rant Objects](#rant-object-simple). |\n| getProfile | Yes | `Profile` | Retrieve the profile of a devRant user by username. The retrieved profile is a [Profile Object](#profile-object). |\n\n\n## Rant Object Simple\n```json\n{\n  \"id\": 43511,\n  \"text\": \"when people think you know everything...\",\n  \"num_upvotes\": 38,\n  \"num_downvotes\": 1,\n  \"score\": 37,\n  \"created_time\": 1464610498,\n  \"attached_image\": {\n    \"url\": \"https://d1fvlyhrbsf219.cloudfront.net/devrant/rant/r_43511_uQDW4.jpg\",\n    \"width\": 600,\n    \"height\": 300\n  },\n  \"num_comments\": 5,\n  \"tags\": [ ],\n  \"vote_state\": 0,\n  \"user_id\": 15601,\n  \"user_username\": \"Mung00se\",\n  \"user_score\": 272\n}\n```\n\n## Rant Object Full\n```json\n{\n  \"rant\": {\n    \"id\": 43511,\n    \"text\": \"when people think you know everything...\",\n    \"num_upvotes\": 39,\n    \"num_downvotes\": 1,\n    \"score\": 38,\n    \"created_time\": 1464610498,\n    \"attached_image\": {\n      \"url\": \"https://d1fvlyhrbsf219.cloudfront.net/devrant/rant/r_43511_uQDW4.jpg\",\n      \"width\": 600,\n      \"height\": 300\n    },\n    \"num_comments\": 5,\n    \"tags\": [ ],\n    \"vote_state\": 0,\n    \"user_id\": 15601,\n    \"user_username\": \"Mung00se\",\n    \"user_score\": 273\n  },\n  \"comments\": [\n    {\n      \"id\": 43529,\n      \"rant_id\": 43511,\n      \"body\": \"But at some point we all do it.\",\n      \"num_upvotes\": 2,\n      \"num_downvotes\": 0,\n      \"score\": 2,\n      \"created_time\": 1464611516,\n      \"vote_state\": 0,\n      \"user_id\": 505,\n      \"user_username\": \"Jumpshot44\",\n      \"user_score\": 2233\n    }\n  ],\n  \"success\": true\n}\n```\n\n## Profile Object\n```json\n{\n  \"username\":\"coookie\",\n  \"score\":553,\n  \"about\":\"Heeeyooo! I am a dev and tho I don't have anything to rant about,  I can be funny sometimes!\",\n  \"location\":\"New delhi\",\n  \"created_time\":1466694150,\n  \"skills\":\"Node.js Android\",\n  \"github\":\"iostreamer-X\",\n  \"content\": {\n    \"content\": {\n      \"rants\": [\n        {\n          \"id\": 38898,\n          \"text\": \"\",\n          \"num_upvotes\": 35,\n          \"num_downvotes\": 0,\n          \"score\": 35,\n          \"created_time\": 1464211080,\n          \"attached_image\": {\n            \"url\": \"https://d1fvlyhrbsf219.cloudfront.net/devrant/rant/r_38898_Z93E9.gif\",\n            \"width\": 380,\n            \"height\": 230\n          },\n          \"num_comments\": 2,\n          \"tags\": [\n            \"teams\",\n            \"integration-testing\",\n            \"dependencies\"\n          ],\n          \"vote_state\": 0,\n          \"user_id\": 27942,\n          \"user_username\": \"danillouz\",\n          \"user_score\": 207\n        }\n      ],\n      \"upvoted\": [\n        {\n          \"id\": 42586,\n          \"text\": \"My office desk\",\n          \"num_upvotes\": 65,\n          \"num_downvotes\": 0,\n          \"score\": 65,\n          \"created_time\": 1464530939,\n          \"attached_image\": {\n            \"url\": \"https://d1fvlyhrbsf219.cloudfront.net/devrant/rant/r_42586_9jWtu.jpg\",\n            \"width\": 800,\n            \"height\": 600\n          },\n          \"num_comments\": 18,\n          \"tags\": [\n            \"mydesk\"\n          ],\n          \"vote_state\": 0,\n          \"user_id\": 13541,\n          \"user_username\": \"dvlpr\",\n          \"user_score\": 104\n        }\n      ],\n      \"comments\": [\n        {\n          \"id\": 41422,\n          \"rant_id\": 41065,\n          \"body\": \"@xroad Hodor\",\n          \"num_upvotes\": 3,\n          \"num_downvotes\": 0,\n          \"score\": 3,\n          \"created_time\": 1464425475,\n          \"vote_state\": 0,\n          \"user_id\": 27942,\n          \"user_username\": \"danillouz\",\n          \"user_score\": 207\n        }\n      ]\n    },\n    \"counts\": {\n      \"rants\": 5,\n      \"upvoted\": 37,\n      \"comments\": 16\n    }\n  }\n}\n```\n\n\n## Examples\n\nYou can see all these functions in action [here](https://github.com/iostreamer-X/devRant-crystal/blob/master/examples/basic.cr)\n\n\n#### Fetch rant with id `141356` in async manner\n\n```crystal\nDevRant.getRantFromIdAsync \"141356\" do |rant|\n  puts rant[\"text\"]\nend\n```\n\n#### Fetch `10` rants of type `top` and skip the first `10`\n```crystal\nDevRant.getRants({\n\t\"sort\" =\u003e 'top',\n\t\"limit\" =\u003e \"10\",\n\t\"skip\" =\u003e \"10\"\n  })\n```\n\n#### Fetch `50` rants of type `recent` and skip `0` by using default and async behavior\n```crystal\nDevRant.getRantsAsync({} of String =\u003e String) do |rants|\n  puts rants[0]\nend\n}\n```\n\n#### Fetch all rants that match the search term `javascript`\n```crystal\nputs DevRant.search(\"javascript\")[0]\n```\n\n#### Fetch the profile of the devRant user with username `dfox` in async manner\n```crystal\nDevRant.getProfileAsync \"dfox\" do |profile|\n  puts profile[\"username\"]\nend\n```\n\n## Contributing\n\n1. Fork it ( https://github.com/iostreamer-X/devRant-crystal/fork )\n2. Create your feature branch (git checkout -b my-new-feature)\n3. Commit your changes (git commit -am 'Add some feature')\n4. Push to the branch (git push origin my-new-feature)\n5. Create a new Pull Request\n\n## Contributors\n\n- [[iostreamer-X]](https://github.com/iostreamer-X) - creator, maintainer\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiostreamer-X%2FdevRant-crystal","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiostreamer-X%2FdevRant-crystal","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiostreamer-X%2FdevRant-crystal/lists"}