From 9720dee187dd5295436226903e0683baf27b7434 Mon Sep 17 00:00:00 2001 From: Alexander Popov Date: Mon, 3 Jan 2022 23:25:07 +0300 Subject: [PATCH] check outdated passwords --- README.md | 26 -------------------------- src/passw0rd_manager.cr | 16 +++++++++++++--- 2 files changed, 13 insertions(+), 29 deletions(-) diff --git a/README.md b/README.md index 9bb74d2..a1076cc 100644 --- a/README.md +++ b/README.md @@ -1,27 +1 @@ # passw0rd_manager - -TODO: Write a description here - -## Installation - -TODO: Write installation instructions here - -## Usage - -TODO: Write usage instructions here - -## Development - -TODO: Write development instructions here - -## Contributing - -1. Fork it () -2. Create your feature branch (`git checkout -b my-new-feature`) -3. Commit your changes (`git commit -am 'Add some feature'`) -4. Push to the branch (`git push origin my-new-feature`) -5. Create a new Pull Request - -## Contributors - -- [Alexander Popov](https://github.com/your-github-user) - creator and maintainer diff --git a/src/passw0rd_manager.cr b/src/passw0rd_manager.cr index 0deb1dd..a697409 100644 --- a/src/passw0rd_manager.cr +++ b/src/passw0rd_manager.cr @@ -51,12 +51,22 @@ while true puts "Help:\n-----" puts ":s - return stats" - puts elsif password_string.to_s == ":s" - print "Elements: " + print "Elements: ".colorize(:yellow) puts new_array.size - puts + print "Outdated: ".colorize(:red) + outdated_count = 0 + current_time = Time.local.to_unix + a = [] of String + new_array.each do |item| + if item.update + (2629743 * 2) < current_time # 2629743 * 2 -- 2 month + outdated_count += 1 + a << item.url + end + end + + puts outdated_count end new_array.each do |item|