parser.add_argument("--no-auto", action="store_true", help="Checks only entries with other than AUTO_DISCOVERY as detection mode.")
parser.add_argument("--no-detection", action="store_true", help="Checks only entries with no detection mode set.")
parser.add_argument("--with-software", action="store_true", help="Checks only entries with any software type detected.")
+ parser.add_argument("--same", action="store_true", help="Checks only entries with domain and software being the same.")
### Fetch instances from instances.social ###
parser = subparser_command.add_parser(
logger.debug("fetched[]='%s'", type(fetched))
if "error_message" in fetched:
- logger.warning("post_json_api() for 'gql.sources.bka.li' returned error message='%s", fetched["error_message"])
+ logger.warning("post_json_api() for 'gql.sources.bka.li' returned error message='%s' - EXIT!", fetched["error_message"])
return 100
elif isinstance(fetched["json"], dict) and "error" in fetched["json"] and "message" in fetched["json"]["error"]:
- logger.warning("post_json_api() returned error: '%s", fetched["error"]["message"])
+ logger.warning("post_json_api() returned error: '%s' - EXIT!", fetched["error"]["message"])
return 101
rows = fetched["json"]
elif args.no_detection:
logger.info("Fetching domains with no detection mode being set ...")
database.cursor.execute("SELECT domain, software FROM instances WHERE detection_mode IS NULL ORDER BY last_updated ASC")
+ elif args.same:
+ logger.info("Fetching domains with domain name and software being the same ...")
+ database.cursor.execute("SELECT domain, software FROM instances WHERE domain=software ORDER BY last_updated ASC")
else:
logger.info("Fetching domains for recently updated ...")
database.cursor.execute("SELECT domain, software FROM instances ORDER BY last_updated ASC")
then
DOMAIN_LIST=$(sqlite3 blocks.db "SELECT domain FROM instances WHERE detection_mode='GENERATOR' ORDER BY last_updated ASC;")
MODE="generator"
-elif [ "$1" = "--same" ]
-then
- DOMAIN_LIST=$(sqlite3 blocks.db "SELECT domain FROM instances WHERE domain=software ORDER BY last_updated ASC;")
- MODE="same"
else
DOMAIN_LIST=$(sqlite3 blocks.db "SELECT domain FROM instances WHERE software IS NULL AND nodeinfo_url IS NOT NULL ORDER BY last_updated ASC;")
fi