Repository: wimglenn/advent-of-code-data (language: python)

Issue:
Include contact information in the user agent, otherwise it will be blocked
https://www.reddit.com/r/adventofcode/comments/z9dhtd/please_include_your_contact_info_in_the_useragent/


Discussion / hints:
We already set a user-agent [since 2016](https://github.com/wimglenn/advent-of-code-data/commit/bcf2dacafdf37622e5bd9797e24ff7f8bf853dce) (aocd v0.3.1)

But in #91 (v1.2.3) I'll make it match the format topaz suggests in that reddit post exactly

Fix patch:
diff --git a/aocd/models.py b/aocd/models.py
index 8db94ee..8b13adf 100644
--- a/aocd/models.py
+++ b/aocd/models.py
@@ -40,7 +40,7 @@
 AOCD_DATA_DIR = os.path.expanduser(os.environ.get("AOCD_DIR", os.path.join("~", ".config", "aocd")))
 AOCD_CONFIG_DIR = os.path.expanduser(os.environ.get("AOCD_CONFIG_DIR", AOCD_DATA_DIR))
 URL = "https://adventofcode.com/{year}/day/{day}"
-USER_AGENT = {"User-Agent": "advent-of-code-data v{}".format(__version__)}
+USER_AGENT = {"User-Agent": "github.com/wimglenn/advent-of-code-data v{} by hey@wimglenn.com".format(__version__)}
 
 
 class User(object):
diff --git a/aocd/version.py b/aocd/version.py
index bc86c94..10aa336 100644
--- a/aocd/version.py
+++ b/aocd/version.py
@@ -1,1 +1,1 @@
-__version__ = "1.2.2"
+__version__ = "1.2.3"


Test patch:
diff --git a/tests/test_get_data.py b/tests/test_get_data.py
index a8e4021..d19f2c8 100644
--- a/tests/test_get_data.py
+++ b/tests/test_get_data.py
@@ -102,7 +102,7 @@ def test_aocd_user_agent_in_req_headers(requests_mock):
     aocd.get_data(year=2018, day=1)
     assert mock.call_count == 1
     headers = mock.last_request._request.headers
-    expected = "advent-of-code-data v{}".format(aocd.__version__)
+    expected = "github.com/wimglenn/advent-of-code-data v{} by hey@wimglenn.com".format(aocd.__version__)
     assert headers["User-Agent"] == expected