diff --git a/.gitignore b/.gitignore index c8341a9..b5db365 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,8 @@ *.png +*.jpg +*.jpeg *.txt -random_image.json +visual_search.json !nouns.txt Todo.md data-dir/ diff --git a/random_image.json b/random_image.json new file mode 100644 index 0000000..c112463 --- /dev/null +++ b/random_image.json @@ -0,0 +1,12 @@ +{ + "title": "File:Porsche 911 RSR-19 - Michael Fassbender, Matt Campbell & Zacharie Robichon at Tertre Rouge at the 2022 Le Mans (54279344199).jpg", + "source": "Wikimedia Commons", + "output_format": "JPEG", + "width": 4835, + "height": 2607, + "original_mime": "image/jpeg", + "original_size": 3786079, + "jpeg_size": 167270, + "original_url": "https://upload.wikimedia.org/wikipedia/commons/f/f7/Porsche_911_RSR-19_-_Michael_Fassbender%2C_Matt_Campbell_%26_Zacharie_Robichon_at_Tertre_Rouge_at_the_2022_Le_Mans_%2854279344199%29.jpg", + "thumbnail_url": "https://upload.wikimedia.org/wikipedia/commons/thumb/f/f7/Porsche_911_RSR-19_-_Michael_Fassbender%2C_Matt_Campbell_%26_Zacharie_Robichon_at_Tertre_Rouge_at_the_2022_Le_Mans_%2854279344199%29.jpg/1280px-Porsche_911_RSR-19_-_Michael_Fassbender%2C_Matt_Campbell_%26_Zacharie_Robichon_at_Tertre_Rouge_at_the_2022_Le_Mans_%2854279344199%29.jpg" +} \ No newline at end of file diff --git a/src/random_image.py b/src/random_image.py index dbb70ac..5f56748 100644 --- a/src/random_image.py +++ b/src/random_image.py @@ -15,7 +15,7 @@ from PIL import Image API_URL = "https://commons.wikimedia.org/w/api.php" OUTPUT_FILE = Path("visual_search.jpg") -METADATA_FILE = Path("random_image.json") +METADATA_FILE = Path("visual_search.json") MAX_ATTEMPTS = 10