finished v1 script + flake setup
This commit is contained in:
parent
f13f566650
commit
70049aad14
33
flake.nix
Normal file
33
flake.nix
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
{
|
||||||
|
description = "Nix flake for the activity logging script";
|
||||||
|
|
||||||
|
outputs =
|
||||||
|
{ self, nixpkgs }:
|
||||||
|
{
|
||||||
|
packages.x86_64-linux.tuh-activity-logger =
|
||||||
|
let
|
||||||
|
pname = "tuh-activity-logger";
|
||||||
|
version = "1.0";
|
||||||
|
pkgs = import nixpkgs { system = "x86_64-linux"; };
|
||||||
|
in
|
||||||
|
pkgs.python3Packages.buildPythonApplication {
|
||||||
|
inherit pname version;
|
||||||
|
src = builtins.path {
|
||||||
|
path = ./.;
|
||||||
|
name = "${pname}-${version}";
|
||||||
|
};
|
||||||
|
build-system = [ pkgs.python3Packages.setuptools ];
|
||||||
|
dependencies =
|
||||||
|
[
|
||||||
|
pkgs.sqlite
|
||||||
|
]
|
||||||
|
++ builtins.attrValues {
|
||||||
|
inherit (pkgs.python3Packages)
|
||||||
|
beautifulsoup4
|
||||||
|
requests
|
||||||
|
matplotlib
|
||||||
|
;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
10
tuhmayto/setup.cfg
Normal file
10
tuhmayto/setup.cfg
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
[metadata]
|
||||||
|
name = tuh-activity-logger
|
||||||
|
|
||||||
|
[options]
|
||||||
|
py_modules =
|
||||||
|
tracker
|
||||||
|
|
||||||
|
[options.entry_points]
|
||||||
|
console_scripts =
|
||||||
|
tuh-activity-logger = tracker:main
|
||||||
3
tuhmayto/setup.py
Normal file
3
tuhmayto/setup.py
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
from setuptools import setup
|
||||||
|
|
||||||
|
setup()
|
||||||
@ -92,7 +92,11 @@ def scrape_and_log(url: str) -> None:
|
|||||||
print(f"Logged activity: {timestamp}")
|
print(f"Logged activity: {timestamp}")
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
def main():
|
||||||
url = "https://es.xhamsterporno.mx/users/johnneal911"
|
url = "https://es.xhamsterporno.mx/users/johnneal911"
|
||||||
setup_database()
|
setup_database()
|
||||||
scrape_and_log(url)
|
scrape_and_log(url)
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user