{"id":20621882,"url":"https://github.com/aristotelesbr/api_quotes","last_synced_at":"2026-05-02T23:33:44.650Z","repository":{"id":90243867,"uuid":"144527835","full_name":"aristotelesbr/api_quotes","owner":"aristotelesbr","description":"Project test for job.","archived":false,"fork":false,"pushed_at":"2018-08-13T23:10:36.000Z","size":78,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-17T05:28:27.577Z","etag":null,"topics":["crawler","mongodb","rails5"],"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/aristotelesbr.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":"2018-08-13T04:03:55.000Z","updated_at":"2018-08-13T23:10:37.000Z","dependencies_parsed_at":null,"dependency_job_id":"eb66f1af-3e52-4cac-8862-7537cb42beac","html_url":"https://github.com/aristotelesbr/api_quotes","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/aristotelesbr%2Fapi_quotes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aristotelesbr%2Fapi_quotes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aristotelesbr%2Fapi_quotes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aristotelesbr%2Fapi_quotes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aristotelesbr","download_url":"https://codeload.github.com/aristotelesbr/api_quotes/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242299460,"owners_count":20105011,"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":["crawler","mongodb","rails5"],"created_at":"2024-11-16T12:19:44.208Z","updated_at":"2025-10-20T03:39:37.292Z","avatar_url":"https://github.com/aristotelesbr.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# === ApiQuotes\n\nSimpleBox is a simple system for importing data from a text file.\nApiQuotes is a simple web crawler for get awesome quotes from: http://quotes.toscrape.com\n\n## Versions:\n```\n- Ruby: 2.5.1\n- Rails: 5.2.1 \n```\n## Requireds gems:\n```\n- mongoid '\u003e= 7.0.1'\n- active_model_serializers', '~\u003e 0.10.7'\n```\n## Test suit:\n```\ngem 'rspec-rails', '~\u003e 3.6'\ngem 'database_cleaner'\ngem 'factory_bot_rails'\ngem 'faker'\ngem 'shoulda-matchers', '~\u003e 3.1'\n```\n\n## Installation:\n\nAssuming you already have the environment properly configured on your machine after cloning the project do:\n\n```shell\n$ cd api_quotes\n```\nInstall dependencies:\n```shell\n$ bundle install\n```\nDownloading data from [Quotes](http://quotes.toscrape.com):\n```shell\n$ rails crawler:run\n```\nRun the tests:\n```shell\n$ bundle exec rspec\n```\nStart server:\n```shell\n$ rails s\n```\n\n## Docker instalation :whale: :sweat_drops:\n\nBuilder installation:\n```shell\n$ docker-compose build\n```\nRun crawler task:\n```shell\n$ docker-compose run --rm web rails crawler:run\n```\nRun the tests:\n```shell\n$ docker-compose run --rm web bundle exec rspec\n```\nStart server:\n```shell\n$ docker-compose up\n```\n## License:\n\n## About this project:\n\nI'm making use of the nokogiri gem to collect data from http://quotes.toscrape.com\n\nI chose to use a rake task as a service to update the database. Making lots of use of POROs I implemented a simple class to separate the search engine if there is a need for new features to search for tags.\n\nUsing a native alternative, found in the official rails documentation [ActionController::HttpAuthentication::Token](https://api.rubyonrails.org/classes/ActionController/HttpAuthentication/Token.html), I added an authorization based on a TOKEN. It must be passed in the request headers (in the key 'Authorization' =\u003e' Token 'mysecretToken') to access the API data.\n\n\n## How to use:\nSend GET request to http://api/v1/quotes?tag=humor with Authirization key and \"Toke 'mysecret'\" to search quotes tags.\n\n#### Example:\n```shell\n$ curl -X GET -H \"Accept: application/json\" -H \"Authorization: Token mysecret\" \"http://localhost:3000/api/v1/quotes?tag=humor\"\n```\n*The return will be something of the type:*\n\n```json\n{\n  \"quotes\":[\n    {\n      \"quote\":\"“The person, be it gentleman or lady, who has not pleasure in a good novel, must be intolerably stupid.”\",\n      \"author\":\"Jane Austen\",\n      \"author_about\":\"http://quotes.toscrape.com/author/Jane-Austen\",\n      \"tags\": [\"aliteracy\",\"books\",\"classic\",\"humor\"]\n    },\n    {\n      \"quote\":\"“A day without sunshine is like, you know, night.”\",\n      \"author\":\"Steve Martin\",\n      \"author_about\":\"http://quotes.toscrape.com/author/Steve-Martin\",\n      \"tags\":[\"humor\",\"obvious\",\"simile\"]\n    }\n  ]\n}\n```\n\n\n#\n## Licence\nThe project is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).\n\n\nDone with :coffee:","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faristotelesbr%2Fapi_quotes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faristotelesbr%2Fapi_quotes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faristotelesbr%2Fapi_quotes/lists"}