Repository: asgrim/year Branch: master Commit: 166c32efdb49 Files: 15 Total size: 3.6 KB Directory structure: gitextract_vwcet6qf/ ├── LICENSE ├── README.md ├── currentYear ├── en/ │ ├── currentYear │ ├── isLeapYear │ ├── nextYear │ └── previousYear ├── he/ │ ├── currentYear │ ├── nextYear │ └── previousYear ├── nextYear ├── previousYear └── zh-cn/ ├── currentYear ├── nextYear └── previousYear ================================================ FILE CONTENTS ================================================ ================================================ FILE: LICENSE ================================================ The MIT License (MIT) Copyright (c) 2015 James Titcumb Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================ FILE: README.md ================================================ YaaS ==== Year as a Service. Providing you with extremely accurate year as an API service, since 2015. * **Current year:** https://raw.github.com/asgrim/year/master/en/currentYear * **Next year:** https://raw.github.com/asgrim/year/master/en/nextYear * **Previous year:** https://raw.github.com/asgrim/year/master/en/previousYear ## Examples Note that these examples may not take into account good security practices, for example escaping output to prevent XSS vulnerabilities. ### PHP ```php resp.json()) .then(year => console.log(year)) // 2025 // XMLHttpRequest let xhr = new XMLHttpRequest() xhr.open('GET', 'https://raw.githubusercontent.com/asgrim/year/master/en/currentYear', true); xhr.onload = () => { if (xhr.status >= 200 && xhr.status < 300 || xhr.status === 304) { console.log(xhr.responseText) } }; xhr.send(); // 2020 ``` ### Bash ```Bash #!/bin/bash ## Fetch page="$(curl -s https://raw.githubusercontent.com/asgrim/year/master/en/currentYear)" echo "$page" # 2025 ``` ## BC Break In the future, we may have to break BC by removing the root "[currentYear](https://raw.github.com/asgrim/year/master/currentYear)". You should use "[en/currentYear](https://raw.github.com/asgrim/year/master/en/currentYear)" instead. ## Internationalisation (i18n) YaaS also supports the following calendars: Hebrew (he): * **Current year:** https://raw.github.com/asgrim/year/master/he/currentYear * **Next year:** https://raw.github.com/asgrim/year/master/he/nextYear * **Previous year:** https://raw.github.com/asgrim/year/master/he/previousYear Chinese (zh-cn): * **Current year:** https://raw.github.com/asgrim/year/master/zh-cn/currentYear * **Next year:** https://raw.github.com/asgrim/year/master/zh-cn/nextYear * **Previous year:** https://raw.github.com/asgrim/year/master/zh-cn/previousYear ## FAQs **Should I use this in my real application?** * No. **r u troleing me?** * Yes. ================================================ FILE: currentYear ================================================ 2026 ================================================ FILE: en/currentYear ================================================ 2026 ================================================ FILE: en/isLeapYear ================================================ false ================================================ FILE: en/nextYear ================================================ 2027 ================================================ FILE: en/previousYear ================================================ 2025 ================================================ FILE: he/currentYear ================================================ 5785 ================================================ FILE: he/nextYear ================================================ 5786 ================================================ FILE: he/previousYear ================================================ 5784 ================================================ FILE: nextYear ================================================ 2027 ================================================ FILE: previousYear ================================================ 2025 ================================================ FILE: zh-cn/currentYear ================================================ 4722 ================================================ FILE: zh-cn/nextYear ================================================ 4723 ================================================ FILE: zh-cn/previousYear ================================================ 4721