1
1
mirror of https://github.com/leon-ai/leon.git synced 2024-12-01 03:15:58 +03:00

Merge branch 'develop' into speedtest_package

This commit is contained in:
Louis Grenard 2019-04-27 13:12:22 +08:00 committed by GitHub
commit 593f264724
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
16 changed files with 434 additions and 84 deletions

2
.gitignore vendored
View File

@ -1,5 +1,6 @@
__pycache__/
.idea/
.vscode/
**/dist/
**/node_modules/
test/coverage/
@ -25,3 +26,4 @@ packages/**/data/db/*.json
server/src/data/expressions/classifier.json
app/js/main.js
package.json.backup
.python-version

View File

@ -1,4 +1,52 @@
# [1.0.0-beta.1](https://github.com/leon-ai/leon/compare/1.0.0-beta.0...v1.0.0-beta.1) (2019-02-24)
# [1.0.0-beta.2](https://github.com/leon-ai/leon/compare/1.0.0-beta.1...1.0.0-beta.2) (2019-04-24)
### Features
- can send custom HTTP headers
([2685cdab](https://github.com/leon-ai/leon/commit/2685cdab07cc1a9ea418eab812e5163d2dd0da90))
- allow HTML output
([ec3f02df](https://github.com/leon-ai/leon/commit/ec3f02dfaf2f4b7623ce350350ebee28cf18740e))
- NLU improvement with node-nlp
([6585db71](https://github.com/leon-ai/leon/commit/6585db718ccae1d750a35783075cf61cc8fe84f1))
- **package/trend:**
- add answer when the Product Hunt developer token is not provided
([f40b479b](https://github.com/leon-ai/leon/commit/f40b479b295247c5a8a0e6ed81afe56fadfd2730))
- Product Hunt module done
([37794306](https://github.com/leon-ai/leon/commit/3779430621bef970be0e8d048eb0b4bf160ae8a4))
- basics done on the Product Hunt module
([32cc7dbe](https://github.com/leon-ai/leon/commit/32cc7dbe36592fb9618d9c10da5f05a4be7e41b6))
- complete dedicated answers according to the technology and given time
([8997d691](https://github.com/leon-ai/leon/commit/8997d6917445f837c9647a5a9b4d6998d2df4952))
- GitHub module done
([7c6f3922](https://github.com/leon-ai/leon/commit/7c6f3922f299193ee0fb54d0fc97f8b436fc706b))
- be able to choose a limit and a date range for the GitHub module
([3c088371](https://github.com/leon-ai/leon/commit/3c0883716e1c10371c399843a578095a1e16781d))
- format GitHub results in one message
([9d026b94](https://github.com/leon-ai/leon/commit/9d026b94efa8871d421ae2b593b96622a98537ac))
- simple GitHub module results
([5baec074](https://github.com/leon-ai/leon/commit/5baec07455f453d4ad003f1da360b2663b7e15e0))
- list GitHub trends in HTML raw
([3441629e](https://github.com/leon-ai/leon/commit/3441629e3cde933b322cb114d9f1bc3ef0eb3944) | [6b932e94](https://github.com/leon-ai/leon/commit/6b932e947fc365ea6435fda798b7cca32708b443))
- expressions dataset and structure
([f406a5a0](https://github.com/leon-ai/leon/commit/f406a5a09894e12c56a1e76dda609adada00b0d7) | [f54c2272](https://github.com/leon-ai/leon/commit/f54c2272b4b4dc5c56b512b0ccc1519d77ef15a3))
### Bug Fixes
- Leon was not fully installed with Docker if a `.env` file was existing
([c8a68ab0](https://github.com/leon-ai/leon/commit/c8a68ab02eec9ddaf803b6e36cd7e91a4989cdea))
- **package/trend:**
when there is no contributor on GitHub module
([d845e49b](https://github.com/leon-ai/leon/commit/d845e49b0f18caeb306e2d399c50a03883b2f55d))
- **server:**
- skip Pipenv locking until they fix it
([029381e3](https://github.com/leon-ai/leon/commit/029381e3256933f37f5c2950c4eb1f0192f55ec6) | [ecfdc73f](https://github.com/leon-ai/leon/commit/ecfdc73f8290dd9e1910df9519095516a1227763))
### Documentation Changes
- add `What is Leon able to do?` section in the readme
([87f53c91](https://github.com/leon-ai/leon/commit/87f53c91368141966959f3ad7299bb7b643828a5) | [d558fc8b](https://github.com/leon-ai/leon/commit/d558fc8b7c6494babf5dec799802227f77c33d8a))
- open-source != open source
([16a9372e](https://github.com/leon-ai/leon/commit/16a9372e05d4d31a7a39a65a52d4708b72499d4c) | [2155cd88](https://github.com/leon-ai/leon/commit/2155cd88decbbd671bd58840291d9330ce06ebba))
# [1.0.0-beta.1](https://github.com/leon-ai/leon/compare/1.0.0-beta.0...1.0.0-beta.1) (2019-02-24)
### Features
- add Docker support
([209760db](https://github.com/leon-ai/leon/commit/209760dba747001300692fb6a6af97543de584d6))
@ -26,6 +74,6 @@
([08a68e37](https://github.com/leon-ai/leon/commit/08a68e376b6a9367425947380564120943376500))
# [1.0.0-beta.0](https://github.com/leon-ai/leon/compare/https://github.com/leon-ai/leon.git...v1.0.0-beta.0) (2019-02-10)
# [1.0.0-beta.0](https://github.com/leon-ai/leon/compare/https://github.com/leon-ai/leon.git...1.0.0-beta.0) (2019-02-10)
Initial release.

View File

@ -8,4 +8,4 @@ packagejsonfile = open(path.dirname(path.realpath(__file__)) + '/../../package.j
packagejson = loads(packagejsonfile.read())
packagejsonfile.close()
useragent = 'Leon/' + packagejson['version']
useragent = 'Leon-Personal-Assistant/' + packagejson['version']

206
package-lock.json generated
View File

@ -5117,9 +5117,9 @@
"dev": true
},
"js-yaml": {
"version": "3.13.0",
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.0.tgz",
"integrity": "sha512-pZZoSxcCYco+DIKBTimr67J6Hy+EYGZDY/HCWC+iAEA9h1ByhMXAIVUXMcMFpOCxQ/xjXmPI2MkDL5HRm5eFrQ==",
"version": "3.13.1",
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz",
"integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==",
"dev": true,
"requires": {
"argparse": "^1.0.7",
@ -6075,14 +6075,12 @@
"balanced-match": {
"version": "1.0.0",
"bundled": true,
"dev": true,
"optional": true
"dev": true
},
"brace-expansion": {
"version": "1.1.11",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"balanced-match": "^1.0.0",
"concat-map": "0.0.1"
@ -6102,8 +6100,7 @@
"concat-map": {
"version": "0.0.1",
"bundled": true,
"dev": true,
"optional": true
"dev": true
},
"console-control-strings": {
"version": "1.1.0",
@ -6251,7 +6248,6 @@
"version": "3.0.4",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"brace-expansion": "^1.1.7"
}
@ -6259,8 +6255,7 @@
"minimist": {
"version": "0.0.8",
"bundled": true,
"dev": true,
"optional": true
"dev": true
},
"minipass": {
"version": "2.3.5",
@ -6364,8 +6359,7 @@
"number-is-nan": {
"version": "1.0.1",
"bundled": true,
"dev": true,
"optional": true
"dev": true
},
"object-assign": {
"version": "4.1.1",
@ -7418,11 +7412,11 @@
}
},
"handlebars": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.1.0.tgz",
"integrity": "sha512-l2jRuU1NAWK6AW5qqcTATWQJvNPEwkM7NEKSiv/gqOsoSQbVoWyqVEY5GS+XPQ88zLNmqASRpzfdm8d79hJS+w==",
"version": "4.1.2",
"resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.1.2.tgz",
"integrity": "sha512-nvfrjqvt9xQ8Z/w0ijewdD/vvWDTOweBUm96NTr66Wfvo1mJenBLwcYmPs3TIBP5ruzYGD7Hx/DaM9RmhroGPw==",
"requires": {
"async": "^2.5.0",
"neo-async": "^2.6.0",
"optimist": "^0.6.1",
"source-map": "^0.6.1",
"uglify-js": "^3.1.4"
@ -8369,24 +8363,114 @@
"integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo="
},
"istanbul-api": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/istanbul-api/-/istanbul-api-2.1.1.tgz",
"integrity": "sha512-kVmYrehiwyeBAk/wE71tW6emzLiHGjYIiDrc8sfyty4F8M02/lrgXSm+R1kXysmF20zArvmZXjlE/mg24TVPJw==",
"version": "2.1.4",
"resolved": "https://registry.npmjs.org/istanbul-api/-/istanbul-api-2.1.4.tgz",
"integrity": "sha512-aAFQL0HA2BLUl18XmTQ7H7CGKI58DtZFvvfmg6e+rA3iNFergvpi16czLV4CpI7HOImMeZ5mqI62dvSNVtUQVA==",
"dev": true,
"requires": {
"async": "^2.6.1",
"compare-versions": "^3.2.1",
"fileset": "^2.0.3",
"istanbul-lib-coverage": "^2.0.3",
"istanbul-lib-hook": "^2.0.3",
"istanbul-lib-instrument": "^3.1.0",
"istanbul-lib-report": "^2.0.4",
"istanbul-lib-source-maps": "^3.0.2",
"istanbul-reports": "^2.1.1",
"js-yaml": "^3.12.0",
"make-dir": "^1.3.0",
"istanbul-lib-coverage": "^2.0.4",
"istanbul-lib-hook": "^2.0.6",
"istanbul-lib-instrument": "^3.2.0",
"istanbul-lib-report": "^2.0.7",
"istanbul-lib-source-maps": "^3.0.5",
"istanbul-reports": "^2.2.2",
"js-yaml": "^3.13.0",
"make-dir": "^2.1.0",
"minimatch": "^3.0.4",
"once": "^1.4.0"
},
"dependencies": {
"debug": {
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz",
"integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==",
"dev": true,
"requires": {
"ms": "^2.1.1"
}
},
"istanbul-lib-coverage": {
"version": "2.0.4",
"resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.4.tgz",
"integrity": "sha512-LXTBICkMARVgo579kWDm8SqfB6nvSDKNqIOBEjmJRnL04JvoMHCYGWaMddQnseJYtkEuEvO/sIcOxPLk9gERug==",
"dev": true
},
"istanbul-lib-instrument": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-3.2.0.tgz",
"integrity": "sha512-06IM3xShbNW4NgZv5AP4QH0oHqf1/ivFo8eFys0ZjPXHGldHJQWb3riYOKXqmOqfxXBfxu4B+g/iuhOPZH0RJg==",
"dev": true,
"requires": {
"@babel/generator": "^7.0.0",
"@babel/parser": "^7.0.0",
"@babel/template": "^7.0.0",
"@babel/traverse": "^7.0.0",
"@babel/types": "^7.0.0",
"istanbul-lib-coverage": "^2.0.4",
"semver": "^6.0.0"
}
},
"istanbul-lib-source-maps": {
"version": "3.0.5",
"resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-3.0.5.tgz",
"integrity": "sha512-eDhZ7r6r1d1zQPVZehLc3D0K14vRba/eBYkz3rw16DLOrrTzve9RmnkcwrrkWVgO1FL3EK5knujVe5S8QHE9xw==",
"dev": true,
"requires": {
"debug": "^4.1.1",
"istanbul-lib-coverage": "^2.0.4",
"make-dir": "^2.1.0",
"rimraf": "^2.6.2",
"source-map": "^0.6.1"
}
},
"istanbul-reports": {
"version": "2.2.2",
"resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-2.2.2.tgz",
"integrity": "sha512-ZFuTdBQ3PSaPnm02aEA4R6mzQ2AF9w03CYiXADzWbbE48v/EFOWF4MaX4FT0NRdqIk48I7o0RPi+S8TMswaCbQ==",
"dev": true,
"requires": {
"handlebars": "^4.1.0"
}
},
"make-dir": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz",
"integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==",
"dev": true,
"requires": {
"pify": "^4.0.1",
"semver": "^5.6.0"
},
"dependencies": {
"semver": {
"version": "5.7.0",
"resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz",
"integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==",
"dev": true
}
}
},
"ms": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz",
"integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==",
"dev": true
},
"semver": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/semver/-/semver-6.0.0.tgz",
"integrity": "sha512-0UewU+9rFapKFnlbirLi3byoOuhrSsli/z/ihNnvM24vgF+8sNBiI1LZPBSH9wJKUwaUbw+s3hToDLCXkrghrQ==",
"dev": true
},
"source-map": {
"version": "0.6.1",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
"integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
"dev": true
}
}
},
"istanbul-lib-coverage": {
@ -8396,9 +8480,9 @@
"dev": true
},
"istanbul-lib-hook": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/istanbul-lib-hook/-/istanbul-lib-hook-2.0.3.tgz",
"integrity": "sha512-CLmEqwEhuCYtGcpNVJjLV1DQyVnIqavMLFHV/DP+np/g3qvdxu3gsPqYoJMXm15sN84xOlckFB3VNvRbf5yEgA==",
"version": "2.0.6",
"resolved": "https://registry.npmjs.org/istanbul-lib-hook/-/istanbul-lib-hook-2.0.6.tgz",
"integrity": "sha512-829DKONApZ7UCiPXcOYWSgkFXa4+vNYoNOt3F+4uDJLKL1OotAoVwvThoEj1i8jmOj7odbYcR3rnaHu+QroaXg==",
"dev": true,
"requires": {
"append-transform": "^1.0.0"
@ -8420,16 +8504,32 @@
}
},
"istanbul-lib-report": {
"version": "2.0.4",
"resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-2.0.4.tgz",
"integrity": "sha512-sOiLZLAWpA0+3b5w5/dq0cjm2rrNdAfHWaGhmn7XEFW6X++IV9Ohn+pnELAl9K3rfpaeBfbmH9JU5sejacdLeA==",
"version": "2.0.7",
"resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-2.0.7.tgz",
"integrity": "sha512-wLH6beJBFbRBLiTlMOBxmb85cnVM1Vyl36N48e4e/aTKSM3WbOx7zbVIH1SQ537fhhsPbX0/C5JB4qsmyRXXyA==",
"dev": true,
"requires": {
"istanbul-lib-coverage": "^2.0.3",
"make-dir": "^1.3.0",
"istanbul-lib-coverage": "^2.0.4",
"make-dir": "^2.1.0",
"supports-color": "^6.0.0"
},
"dependencies": {
"istanbul-lib-coverage": {
"version": "2.0.4",
"resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.4.tgz",
"integrity": "sha512-LXTBICkMARVgo579kWDm8SqfB6nvSDKNqIOBEjmJRnL04JvoMHCYGWaMddQnseJYtkEuEvO/sIcOxPLk9gERug==",
"dev": true
},
"make-dir": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz",
"integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==",
"dev": true,
"requires": {
"pify": "^4.0.1",
"semver": "^5.6.0"
}
},
"supports-color": {
"version": "6.1.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.1.0.tgz",
@ -8477,15 +8577,6 @@
}
}
},
"istanbul-reports": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-2.1.1.tgz",
"integrity": "sha512-FzNahnidyEPBCI0HcufJoSEoKykesRlFcSzQqjH9x0+LC8tnnE/p/90PBLu8iZTxr8yYZNyTtiAujUqyN+CIxw==",
"dev": true,
"requires": {
"handlebars": "^4.1.0"
}
},
"japanese": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/japanese/-/japanese-1.2.0.tgz",
@ -10150,9 +10241,9 @@
"dev": true
},
"js-yaml": {
"version": "3.12.1",
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.12.1.tgz",
"integrity": "sha512-um46hB9wNOKlwkHgiuyEVAybXBjwFUV0Z/RaHJblRd9DXltue9FTYvzCr9ErQrK9Adz5MU4gHWVaNUfdmrC8qA==",
"version": "3.13.1",
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz",
"integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==",
"dev": true,
"requires": {
"argparse": "^1.0.7",
@ -11057,6 +11148,11 @@
"resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.1.tgz",
"integrity": "sha1-KzJxhOiZIQEXeyhWP7XnECrNDKk="
},
"neo-async": {
"version": "2.6.0",
"resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.0.tgz",
"integrity": "sha512-MFh0d/Wa7vkKO3Y3LlacqAEeHK0mckVqzDieUKTT+KGxi+zIpeVsFxymkIiRpbpDziHc290Xr9A1O4Om7otoRA=="
},
"nice-try": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz",
@ -14377,19 +14473,19 @@
"dev": true
},
"uglify-js": {
"version": "3.4.9",
"resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.4.9.tgz",
"integrity": "sha512-8CJsbKOtEbnJsTyv6LE6m6ZKniqMiFWmm9sRbopbkGs3gMPPfd3Fh8iIA4Ykv5MgaTbqHr4BaoGLJLZNhsrW1Q==",
"version": "3.5.4",
"resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.5.4.tgz",
"integrity": "sha512-GpKo28q/7Bm5BcX9vOu4S46FwisbPbAmkkqPnGIpKvKTM96I85N6XHQV+k4I6FA2wxgLhcsSyHoNhzucwCflvA==",
"optional": true,
"requires": {
"commander": "~2.17.1",
"commander": "~2.20.0",
"source-map": "~0.6.1"
},
"dependencies": {
"commander": {
"version": "2.17.1",
"resolved": "https://registry.npmjs.org/commander/-/commander-2.17.1.tgz",
"integrity": "sha512-wPMUt6FnH2yzG95SA6mzjQOEKUU3aLaDEmzs1ti+1E9h+CsrZghRlqEM/EJ4KscsQVG8uNN4uVreUeT8+drlgg==",
"version": "2.20.0",
"resolved": "https://registry.npmjs.org/commander/-/commander-2.20.0.tgz",
"integrity": "sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ==",
"optional": true
},
"source-map": {

View File

@ -15,3 +15,25 @@ Ping domain names and give you the online state.
(fr-FR) "Vérifies si github.com, un-super-nom-de-domaine.fr et twitter.com sont en ligne"
...
```
### Have I Been Pwned
Verify if a or several email addresses have been pwned.
#### Usage
```
(en-US) "Has louis.grenard@gmail.com been pwned?"
(en-US) "Have iifeoluwa.ao@gmail.com, louis.grenard@gmail.com, and supercleanemail@test.com have been pwned?"
(fr-FR) "Est-ce que louis.grenard@gmail.com est compromis ?"
(fr-FR) "Est-ce que iifeoluwa.ao@gmail.com, louis.grenard@gmail.com, et supercleanemail@test.com ont été compromis ?"
```
You can also predefined one or several email addresses in the `packages/checker/config/config.json` file at the `haveibeenpwned.emails` key.
If you do, then you can use such sentences:
```
(en-US) "Have my email addresses been pwned?"
(fr-FR) "Est-ce que mes adresses email ont été compromises ?"
```

View File

@ -1,5 +1,9 @@
{
"isitdown": {
"options": {}
}
},
"haveibeenpwned": {
"emails": [],
"options": {}
}
}

View File

@ -23,5 +23,35 @@
"Please provide me at least one valid domain name.",
"You did not gave me a valid domain name."
]
},
"haveibeenpwned": {
"no-pwnage": [
"Great news, \"%email%\" hasn't been compromised in a data breach.",
"\"%email%\" looks good to me!"
],
"pwned": [
"Oops, looks like \"%email%\" has been compromised in at least one breach involving:<br><br><ul>%result%</ul>",
"Sadly, \"%email%\" was affected in the following breaches:<br><br><ul>%result%</ul>",
"Unfortunately, \"%email%\" has been exposed in a data breach affecting:<br><br><ul>%result%</ul>"
],
"list_element": [
"<li><a href=\"%url%\" target=\"_blank\">%name%</a> with a total of %total% accounts.</li>"
],
"checking": [
"I'm checking for a compromised email...",
"Trying to verify pwnage status..."
],
"no-email": [
"Please provide one or more email addresses you need me to check."
],
"errors": [
"I think %website_name% is down at the moment, please try again later.",
"I'm having trouble reaching %website_name%. Please check that your internet connection is active.",
"Bad news, %website_name% is not responding. Maybe try at a later time?"
],
"blocked": [
"There was an issue acessing %website_name%'s service.",
"Unfortunate news, %website_name% isn't granting me access to its service."
]
}
}

View File

@ -23,5 +23,32 @@
"Merci de fournir au moins un nom de domaine valide.",
"Vous ne m'avez pas donné de nom de domaine valide."
]
},
"haveibeenpwned": {
"no-pwnage": [
"Bonne nouvelle, %email% n'a pas été compromis par une violation de données.",
"%email% cela me semble correct!"
],
"pwned": [
"Oups, on dirait que %email% a été compromis par une infraction impliquant %breach%.",
"%breach% a été impliqué dans une brèche. Malheureusement, %email% a été touché.",
"Malheureusement, %email% a été exposé à une violation de données affectant %breach%."
],
"checking": [
"Je cherche un email compromis.",
"Essayer de vérifier le statut de pwnage."
],
"no-email": [
"Veuillez fournir une ou plusieurs adresses électroniques que vous devez vérifier.."
],
"errors": [
"Je pense que %website_name% est en panne pour le moment, veuillez réessayer plus tard.",
"J'ai du mal à joindre %website_name%. Veuillez vérifier que votre connexion Internet est active.",
"Mauvaise nouvelle, %website_name% ne répond pas. Peut-être essayer plus tard?"
],
"blocked": [
"Il y avait un problème d'accès au service de %website_name%.",
"Malheureusement, %website_name% ne me donne pas accès à son service."
]
}
}

View File

@ -12,5 +12,18 @@
"Check if nodejs.org is up",
"Check if nodejs.org is working",
"Check if amazon.com is up or down"
],
"haveibeenpwned": [
"Has iifeoluwa.ao@gmail.com been pwned?",
"Has iifeoluwa.ao@gmail.com been compromised?",
"Has iifeoluwa.ao@gmail.com been exposed in a breach?",
"Is iifeoluwa.ao@gmail.com still uncompromised?",
"Is iifeoluwa.ao@gmail.com compromised?",
"Have my email address been pwned?",
"Check that iifeoluwa.ao@gmail.com and louis.grenard@gmail.com haven't been compromised",
"Check that iifeoluwa.ao@gmail.com and louis.grenard@gmail.com haven't been pwned",
"Check that iifeoluwa.ao@gmail.com and louis.grenard@gmail.com haven't been exposed in a breach",
"Verify the pwnage status of iifeoluwa.ao@gmail.com",
"Verify the pwnage status of iifeoluwa.ao@gmail.com and louis.grenard@gmail.com"
]
}

View File

@ -12,5 +12,16 @@
"Vérifies si nodejs.org en ligne",
"Vérifies si nodejs.org fonctionne",
"Vérifies si amazon.com en ligne ou hors ligne"
],
"haveibeenpwned": [
"iifeoluwa.ao@gmail.com a-t-ele été pwned ?",
"iifeoluwa.ao@gmail.com a-t-elle été compromise ?",
"iifeoluwa.ao@gmail.com a-t-elle été exposée à une brèche ?",
"iifeoluwa.ao@gmail.com est-elle toujours non compromise ?",
"Est-ce que iifeoluwa.ao@gmail.com est compromise ?",
"Est-ce que mon adresse email a été compromise ?",
"Vérifies que iifeoluwa.ao@gmail.com et louis.grenard@gmail.com n'ont pas été compromise",
"Vérifies que iifeoluwa.ao@gmail.com et louis.grenard@gmail.com n'ont pas été pwned",
"Vérifies que iifeoluwa.ao@gmail.com et louis.grenard@gmail.com n'ont pas été exposées à une brèche"
]
}

View File

@ -0,0 +1,69 @@
#!/usr/bin/env python
# -*- coding:utf-8 -*-
import utils
from time import sleep
from urllib import parse
from requests import codes, exceptions
def haveibeenpwned(string, entities):
emails = []
for item in entities:
if item['entity'] == 'email':
emails.append(item['resolution']['value'])
if not emails:
emails = utils.config('emails')
if not emails:
return utils.output('end', 'no-email', utils.translate('no-email'))
utils.output('inter', 'checking', utils.translate('checking'))
for index, email in enumerate(emails):
isLastEmail = index == len(emails) - 1
breached = checkForBreach(email)
data = { 'email': email }
# Have I Been Pwned API returns a 403 when accessed by unauthorized/banned clients
if breached == 403:
return utils.output('end', 'blocked', utils.translate('blocked', { 'website_name': 'Have I Been Pwned' }))
elif not breached:
if isLastEmail:
return utils.output('end', 'no-pwnage', utils.translate('no-pwnage', data))
else:
utils.output('inter', 'no-pwnage', utils.translate('no-pwnage', data))
else:
data['result'] = ''
for index, b in enumerate(breached):
data['result'] += utils.translate('list_element', {
'url': 'http://' + b['Domain'],
'name': b['Name'],
'total': b['PwnCount']
}
)
if isLastEmail:
return utils.output('end', 'pwned', utils.translate('pwned', data))
else:
utils.output('inter', 'pwned', utils.translate('pwned', data))
def checkForBreach(email):
# Delay for 2 seconds before making request to accomodate API usage policy
sleep(2)
truncate = '?truncateResponse=true'
url = 'https://haveibeenpwned.com/api/v2/breachedaccount/' + parse.quote_plus(email)
try:
response = utils.http('GET', url)
if response.status_code == 404:
return None
elif response.status_code == 200:
return response.json()
return response.status_code
except exceptions.RequestException as e:
return utils.output('end', 'down', utils.translate('errors', { 'website_name': 'Have I Been Pwned' }))

View File

@ -0,0 +1,23 @@
'use strict'
describe('checker:haveibeenpwned', async () => {
test('checks if an email address has been pwned', async () => {
global.nlu.brain.execute = jest.fn()
await global.nlu.process('Has supercleanemailaddress@supercleandomainname.com been pwned?')
const [obj] = global.nlu.brain.execute.mock.calls
await global.brain.execute(obj[0])
expect(global.brain.finalOutput.codes).toIncludeSameMembers(['checking', 'no-pwnage'])
})
test('checks if multiple email addresses have been pwned', async () => {
global.nlu.brain.execute = jest.fn()
await global.nlu.process('Verify the pwnage status of supercleanemailaddress@supercleandomainname.com and test@toto.com')
const [obj] = global.nlu.brain.execute.mock.calls
await global.brain.execute(obj[0])
expect(global.brain.finalOutput.codes).toIncludeSameMembers(['checking', 'no-pwnage', 'pwned'])
})
})

View File

@ -1 +1 @@
1.0.0
1.1.0

View File

@ -66,12 +66,17 @@ def github(string, entities):
author = element.img.get('alt')[1:]
else:
author = '?'
stars = element.select('span.d-inline-block.float-sm-right')[0].get_text(strip=True).split(' ')[0]
separators = [' ', ',', '.']
# Replace potential separators number
for j, separator in enumerate(separators):
stars = stars.replace(separator, '')
hasstars = element.select('span.d-inline-block.float-sm-right')
stars = 0
if hasstars:
stars = element.select('span.d-inline-block.float-sm-right')[0].get_text(strip=True).split(' ')[0]
separators = [' ', ',', '.']
# Replace potential separators number
for j, separator in enumerate(separators):
stars = stars.replace(separator, '')
result += utils.translate('list_element', {
'rank': i + 1,

View File

@ -28,7 +28,7 @@ export default version => new Promise(async (resolve, reject) => {
const repoUrl = sh.stdout.substr(0, sh.stdout.lastIndexOf('.git'))
const previousTag = sh.stdout.substr(sh.stdout.indexOf('\n') + 1).trim()
const changelogData = fs.readFileSync(changelog, 'utf8')
const compareUrl = `${repoUrl}/compare/${previousTag}...v${version}`
const compareUrl = `${repoUrl}/compare/${previousTag}...${version}`
let tmpData = fs.readFileSync(`scripts/tmp/${tmpChangelog}`, 'utf8')
log.success(`Remote origin URL gotten: ${repoUrl}.git`)

View File

@ -1,31 +1,31 @@
{
"lang": "en",
"package": "checker",
"module": "isitdown",
"query": "Check if github.com, mozilla.org and twitter.com are up",
"module": "haveibeenpwned",
"query": "Check if louis.grenard@gmail.com and louistiti42@gmail.com have been pwned",
"entities": [
{
"sourceText": "github.com",
"utteranceText": "github.com",
"entity": "url",
"start": 12,
"end": 33,
"len": 22,
"accuracy": 0.95,
"sourceText": "something@somehost.com",
"utteranceText": "something@somehost.com",
"entity": "email",
"resolution": {
"value": "github.com"
"value": "louis.grenard@gmail.com"
}
},
{
"sourceText": "mozilla.org",
"utteranceText": "mozilla.org",
"entity": "url",
"start": 12,
"end": 33,
"len": 22,
"accuracy": 0.95,
"sourceText": "something@somehost.com",
"utteranceText": "something@somehost.com",
"entity": "email",
"resolution": {
"value": "mozilla.org"
}
},
{
"sourceText": "twitter.com",
"utteranceText": "twitter.com",
"entity": "url",
"resolution": {
"value": "twitter.com"
"value": "louistiti42@gmail.com"
}
}
]