├── .nvmrc ├── .gitignore ├── DOCUMENTATION.md ├── package.json ├── test └── index.js ├── index.js ├── README-ptBR.md ├── LICENSE ├── README.md └── CONTRIBUTING.md /.nvmrc: -------------------------------------------------------------------------------- 1 | 7.9.0 -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.swp 2 | *.swo 3 | *~ 4 | *.log 5 | node_modules 6 | *.env 7 | .DS_Store 8 | package-lock.json 9 | .bloggify/* 10 | -------------------------------------------------------------------------------- /DOCUMENTATION.md: -------------------------------------------------------------------------------- 1 | ## Documentation 2 | 3 | You can see below the API reference of this module. 4 | 5 | ### `getVerse(reference, callback)` 6 | Gets the reference using labs.bible.org provider. 7 | 8 | #### Params 9 | 10 | - **String** `reference`: Bible verse reference 11 | - **Function** `callback`: The callback function 12 | 13 | #### Return 14 | - **** 15 | 16 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "bible-portuguese", 3 | "version": "1.0.0", 4 | "description": "Portuguese Bible module", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "node test/index.js" 8 | }, 9 | "repository": { 10 | "type": "git", 11 | "url": "git+https://github.com/BibleJS/bible-portuguese.git" 12 | }, 13 | "keywords": [ 14 | "bible", 15 | "portuguese", 16 | "node" 17 | ], 18 | "dependencies": { 19 | "request": "^2.65.0" 20 | }, 21 | "author": "Raphael Amorim", 22 | "license": "MIT", 23 | "bugs": { 24 | "url": "https://github.com/BibleJS/bible-portuguese/issues" 25 | }, 26 | "homepage": "https://github.com/BibleJS/bible-portuguese#readme", 27 | "devDependencies": { 28 | "prova": "^3.0.0" 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /test/index.js: -------------------------------------------------------------------------------- 1 | // Dependencies 2 | var test = require("prova"), 3 | PtBible = require("../index"); 4 | 5 | var validVerse = { 6 | reference: "Mateus 1:1", 7 | verses: [{ 8 | book_id: "MAT", 9 | book_name: "Mateus", 10 | chapter: 1, 11 | verse: 1, 12 | text: "Livro da genealogia de Jesus Cristo, filho de Davi, filho de Abraão.   " 13 | }], 14 | text: "Livro da genealogia de Jesus Cristo, filho de Davi, filho de Abraão.   ", 15 | translation_id: "almeida", 16 | translation_name: "João Ferreira de Almeida", 17 | translation_note: "Public Domain" 18 | } 19 | 20 | test("Return proper verse", function(t) { 21 | t.plan(2); 22 | 23 | // Get verse 24 | PtBible.getVerse("Mateus 1:1", function(err, data) { 25 | t.error(err); 26 | t.same(data, validVerse); 27 | }); 28 | }); -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | // Dependencies 2 | var Request = require("request"); 3 | 4 | // Constants 5 | const PROVIDER = 'http://bible-api.com/', 6 | TRANSLATION = '?translation=almeida'; 7 | 8 | // Constructor 9 | const BiblePortuguese = module.exports = {}; 10 | 11 | /** 12 | * getVerse 13 | * Gets the reference using labs.bible.org provider. 14 | * 15 | * @name getVerse 16 | * @function 17 | * @param {String} reference Bible verse reference 18 | * @param {Function} callback The callback function 19 | * @return 20 | */ 21 | BiblePortuguese.getVerse = function (reference, callback) { 22 | 23 | if (typeof reference === "object") { 24 | reference = this.reference; 25 | } 26 | 27 | Request.get({ 28 | json: true 29 | , url: PROVIDER + reference + TRANSLATION 30 | }, (err, response, body) => { 31 | 32 | if (err || response.statusCode !== 200) { 33 | return callback (err || response.message); 34 | } 35 | 36 | // TODO check response 37 | callback (null, body); 38 | }); 39 | }; 40 | -------------------------------------------------------------------------------- /README-ptBR.md: -------------------------------------------------------------------------------- 1 | # Bible Portuguese 2 | Módulo `BibleJS` Português 3 | 4 | ## Instalação 5 | Execute os seguintes comandos para baixar e instalar o aplicativo: 6 | 7 | ```sh 8 | $ git clone git@github.com:BibleJS/bible-portuguese.git bible-portuguese 9 | $ cd bible-portuguese 10 | $ npm install 11 | ``` 12 | 13 | ## Exemplo 14 | 15 | ```js 16 | // Dependências 17 | var PtBible = require("bible-portuguese"); 18 | 19 | // Pegar verso 20 | PtBible.getVerse("Mateus 1:1", function (err, data) { 21 | console.log(err || data); 22 | }); 23 | 24 | ``` 25 | 26 | ## Como contribuir 27 | 28 | 1. Crie uma Issue no repositório, usando o rastreador de bugs, descrevendo a contribuição que você gostaria de fazer. Isso nos ajudará a começar com o pé direito. 29 | 2. Forque o projeto em sua conta e crie uma nova branch: `nome-da-branch`. 30 | 3. Escreva o código e os testes, execute `npm test` para confirmar que tudo funciona. 31 | 3. Coloque suas alterações na branch que você criou. 32 | 4. Abra um Pull Request e faça referência a questão inicial na mensagem da solicitação (da resolução de um problema). 33 | 34 | ## Licença 35 | Veja a [LICENÇA](./LICENSE). 36 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015-20 Raphael Amorim 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | # bible-portuguese 21 | 22 | [![Version](https://img.shields.io/npm/v/bible-portuguese.svg)](https://www.npmjs.com/package/bible-portuguese) [![Downloads](https://img.shields.io/npm/dt/bible-portuguese.svg)](https://www.npmjs.com/package/bible-portuguese) 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | > Portuguese Bible module 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | ## :cloud: Installation 49 | 50 | ```sh 51 | # Using npm 52 | npm install --save bible-portuguese 53 | 54 | # Using yarn 55 | yarn add bible-portuguese 56 | ``` 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | ## :question: Get Help 80 | 81 | There are few ways to get help: 82 | 83 | 84 | 85 | 1. Please [post questions on Stack Overflow](https://stackoverflow.com/questions/ask). You can open issues with questions, as long you add a link to your Stack Overflow question. 86 | 2. For bug reports and feature requests, open issues. :bug: 87 | 88 | 89 | 90 | 91 | 92 | ## :memo: Documentation 93 | 94 | 95 | ### `getVerse(reference, callback)` 96 | Gets the reference using labs.bible.org provider. 97 | 98 | #### Params 99 | 100 | - **String** `reference`: Bible verse reference 101 | - **Function** `callback`: The callback function 102 | 103 | #### Return 104 | - **** 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | ## :yum: How to contribute 120 | Have an idea? Found a bug? See [how to contribute][contributing]. 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | ## :scroll: License 146 | 147 | [MIT][license] © [Raphael Amorim][website] 148 | 149 | 150 | 151 | 152 | 153 | 154 | [license]: /LICENSE 155 | [website]: undefined 156 | [contributing]: /CONTRIBUTING.md 157 | [docs]: /DOCUMENTATION.md 158 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # :eight_spoked_asterisk: :stars: :sparkles: :dizzy: :star2: :star2: :sparkles: :dizzy: :star2: :star2: Contributing :star: :star2: :dizzy: :sparkles: :star: :star2: :dizzy: :sparkles: :stars: :eight_spoked_asterisk: 2 | 3 | So, you want to contribute to this project! That's awesome. However, before 4 | doing so, please read the following simple steps how to contribute. This will 5 | make the life easier and will avoid wasting time on things which are not 6 | requested. :sparkles: 7 | 8 | ## Discuss the changes before doing them 9 | - First of all, open an issue in the repository, using the [bug tracker][1], 10 | describing the contribution you would like to make, the bug you found or any 11 | other ideas you have. This will help us to get you started on the right 12 | foot. 13 | 14 | - If it makes sense, add the platform and software information (e.g. operating 15 | system, Node.JS version etc.), screenshots (so we can see what you are 16 | seeing). 17 | 18 | - It is recommended to wait for feedback before continuing to next steps. 19 | However, if the issue is clear (e.g. a typo) and the fix is simple, you can 20 | continue and fix it. 21 | 22 | ## Fixing issues 23 | - Fork the project in your account and create a branch with your fix: 24 | `some-great-feature` or `some-issue-fix`. 25 | 26 | - Commit your changes in that branch, writing the code following the 27 | [code style][2]. If the project contains tests (generally, the `test` 28 | directory), you are encouraged to add a test as well. :memo: 29 | 30 | - If the project contains a `package.json` or a `bower.json` file add yourself 31 | in the `contributors` array (or `authors` in the case of `bower.json`; 32 | if the array does not exist, create it): 33 | 34 | ```json 35 | { 36 | "contributors": [ 37 | "Your Name (http://your.website)" 38 | ] 39 | } 40 | ``` 41 | 42 | ## Creating a pull request 43 | 44 | - Open a pull request, and reference the initial issue in the pull request 45 | message (e.g. *fixes #*). Write a good description and 46 | title, so everybody will know what is fixed/improved. 47 | 48 | - If it makes sense, add screenshots, gifs etc., so it is easier to see what 49 | is going on. 50 | 51 | ## Wait for feedback 52 | Before accepting your contributions, we will review them. You may get feedback 53 | about what should be fixed in your modified code. If so, just keep committing 54 | in your branch and the pull request will be updated automatically. 55 | 56 | ## Everyone is happy! 57 | Finally, your contributions will be merged, and everyone will be happy! :smile: 58 | Contributions are more than welcome! 59 | 60 | Thanks! :sweat_smile: 61 | 62 | 63 | 64 | [1]: https://github.com/BibleJS/bible-portuguese/issues 65 | 66 | [2]: https://github.com/IonicaBizau/code-style 67 | --------------------------------------------------------------------------------