diff --git a/LICENSE b/LICENSE index f795c23..5baee6c 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2024 Liam Steckler +Copyright (c) 2023 Liam Steckler 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: diff --git a/config-sample.yml b/config-sample.yml deleted file mode 100644 index 61137b9..0000000 --- a/config-sample.yml +++ /dev/null @@ -1,5 +0,0 @@ -mastodon: - client_id: - client_secret: - access_token: - api_base_url: diff --git a/kuow_fetcher.py b/kuow_fetcher.py index 293cf9c..0c329cf 100644 --- a/kuow_fetcher.py +++ b/kuow_fetcher.py @@ -1,5 +1,4 @@ import requests -import yaml from bs4 import BeautifulSoup from mastodon import Mastodon @@ -9,18 +8,10 @@ url = ( + "/fragments?name=story_grid&source=homepage&view_id=1&page=1&per_page=12" ) log_file = "kuow_bot_logfile.txt" -config = yaml.safe_load(open("config.yml")) -stadiamaps_api_key = config["stadiamaps"]["api_key"] -nominatim_url = config["nominatim"]["api_base_url"] -mastodon = Mastodon( - client_id=config["mastodon"]["client_id"], - client_secret=config["mastodon"]["client_secret"], - access_token=config["mastodon"]["access_token"], - api_base_url=config["mastodon"]["api_base_url"], -) +mastodon = Mastodon(access_token="kuow_bot_mastodon.secret") -kuow_response = requests.get(url) -soup = BeautifulSoup(kuow_response.content, "html.parser") +r = requests.get(url) +soup = BeautifulSoup(r.content, "html.parser") articles = soup.find_all("span", class_="txt") # Reverse articles, so that if multiple new ones have been found, they'll be posted in order of when published articles.reverse() diff --git a/requirements.txt b/requirements.txt index f406dab..4029575 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,13 +1,3 @@ beautifulsoup4==4.12.2 -blurhash==1.1.4 -certifi==2023.11.17 -charset-normalizer==3.3.2 -decorator==5.1.1 -idna==3.6 Mastodon.py==1.8.0 -python-dateutil==2.8.2 -python-magic==0.4.27 -requests==2.28.2 -six==1.16.0 -soupsieve==2.5 -urllib3==1.26.18 +requests==2.28.2 \ No newline at end of file