Skip to content

Commit 496a4c8

Browse files
committed
add comics.py
1 parent 26e2810 commit 496a4c8

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

examples/spectra6/comic_vine/comic.py renamed to examples/spectra6/comics/comic.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
BASE_URL = "https://comicvine.gamespot.com/api/"
1818
HEADERS = {"User-Agent": "Python Comic Vine Client"}
1919

20-
# Change this to the comic series you want to display:
21-
SEARCH_QUERY = "Weird Science"
20+
# List of comic series to display, separated by commas. You can add more series to this list, or change the existing ones.
21+
SEARCH_QUERIES = ["Weird Science"]
2222
# Set to True to pick a random volume from the query results (this is helpful if the series is split into multiple volumes):
2323
RANDOM_VOLUME = False
2424

@@ -88,7 +88,9 @@ def display_image_on_inky(image_url):
8888

8989

9090
try:
91-
volume_id = find_volume_id(API_KEY, SEARCH_QUERY)
91+
# Pick a random search term from the list
92+
search_query = random.choice(SEARCH_QUERIES)
93+
volume_id = find_volume_id(API_KEY, search_query)
9294
comic_image_url = fetch_random_comic_image(API_KEY, volume_id)
9395
display_image_on_inky(comic_image_url)
9496
except Exception as e:

0 commit comments

Comments
 (0)