summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob McDonnell <jacob@simplelittledream.com>2022-10-07 22:13:06 -0400
committerJacob McDonnell <jacob@simplelittledream.com>2022-10-07 22:13:06 -0400
commit3d4a76345194c9fb47475fc83d40567e8c451ed9 (patch)
tree4809af9c9c6153b0054d61c3d3896022713e7db1
parentfc496845f27292fc4fa467ea2db9d68f0370f1e3 (diff)
Reformatted Files
-rw-r--r--Example.settings.json28
-rw-r--r--README.md7
-rw-r--r--news.py2
-rw-r--r--settings.json30
4 files changed, 35 insertions, 32 deletions
diff --git a/Example.settings.json b/Example.settings.json
new file mode 100644
index 0000000..c0b654d
--- /dev/null
+++ b/Example.settings.json
@@ -0,0 +1,28 @@
+{
+ "calendars": {
+ "NAME": "URL"
+ },
+ "weather": {
+ "gridX": 39,
+ "gridY": 86,
+ "WFO": "PHI",
+ "Units": "si",
+ "Hours": 24
+ },
+ "news": {
+ "country": "us",
+ "apikey": "API KEY NEEDED"
+ },
+ "modules": {
+ "quote": 1,
+ "national day": 1,
+ "Detailed": 1,
+ "Hourly": 1,
+ "calendar": 1,
+ "news": 0
+ },
+ "general": {
+ "name": "yourName",
+ "Line Width": 32
+ }
+} \ No newline at end of file
diff --git a/README.md b/README.md
index 496ddb0..4e57f76 100644
--- a/README.md
+++ b/README.md
@@ -11,6 +11,7 @@ interface with the
[adafruit thermal printer used](https://www.adafruit.com/product/600).
## TODO
+- Add comments to all functions for better documentation
- Timer for the main function
- Stock Tracker
- Better error handling
@@ -27,4 +28,8 @@ interface with the
- [Quotable](https://quotable.io)
- [National Weather Service](https://www.weather.gov/documentation/services-web-api)
- [News API](https://newsapi.org/)
-- [National Day API](https://national-api-day.herokuapp.com) \ No newline at end of file
+- [National Day API](https://national-api-day.herokuapp.com)
+
+## Setup
+Rename Example.settings.json to settings.json and fill in the needed
+information. \ No newline at end of file
diff --git a/news.py b/news.py
index 6c486c5..e9afeab 100644
--- a/news.py
+++ b/news.py
@@ -3,7 +3,7 @@ import json
from time import sleep
from settings import news
-apiKey = "17d4d578091e47db9791e84d790391b5"
+apiKey = news["apikey"]
countryCode = news["country"]
url = f"https://newsapi.org/v2/top-headlines?country={countryCode}&apiKey={apiKey}"
diff --git a/settings.json b/settings.json
deleted file mode 100644
index c934968..0000000
--- a/settings.json
+++ /dev/null
@@ -1,30 +0,0 @@
-{
- "calendars": {
- "School": "https://outlook.office365.com/owa/calendar/412f8b78a8564989926618247daea585@psu.edu/2cd13fc6692a4dfa978b34987cb2277a8238352227218615013/calendar.ics",
- "Personal": "https://p71-caldav.icloud.com/published/2/MTY4Njk4MjQ4NjAxNjg2OUkA_BmX5UzH5rSvF5SwlIEXsORegc3ndydzGjQdvBCe",
- "Family": "https://p71-caldav.icloud.com/published/2/MTY4Njk4MjQ4NjAxNjg2OUkA_BmX5UzH5rSvF5SwlIHdQtKK2Blxp39QaXZJbzGagcAtA1ewsskMgUHIAOpeV-OHMazKljffEQIYmOMtqsk",
- "Work": "https://p71-caldav.icloud.com/published/2/MTY4Njk4MjQ4NjAxNjg2OUkA_BmX5UzH5rSvF5SwlIFA9IsJGmQmyPJL3YEE9lJc"
- },
- "weather": {
- "gridX": 39,
- "gridY": 86,
- "WFO": "PHI",
- "Units": "si",
- "Hours": 24
- },
- "news": {
- "country": "us"
- },
- "modules": {
- "quote": 1,
- "national day": 1,
- "Detailed": 1,
- "Hourly": 1,
- "calendar": 1,
- "news": 0
- },
- "general": {
- "name": "Jacob",
- "Line Width": 32
- }
-} \ No newline at end of file