update status_pathname
authorClaromes <claromes@hey.com>
Sun, 16 Jun 2024 00:23:09 +0000 (21:23 -0300)
committerClaromes <claromes@hey.com>
Sun, 16 Jun 2024 00:23:09 +0000 (21:23 -0300)
docs/cli.rst
waybacktweets/api/request_tweets.py

index 0d6b8f32865051b3a32c43a5fd976f8dc9a128b9..f6f19fc1908eb61873d4b595546ca1346358f259 100644 (file)
@@ -47,7 +47,7 @@ URL Match Scope
 
 The CDX Server can return results matching a certain prefix, a certain host or all subdomains by using the ``matchType`` param.
 
-For example, with the value ``prefix`` it is possible to retrieve URLs beyond `/status/`.
+The package ``waybacktweets`` uses the pathname ``/status`` followed by the wildcard '*' at the end of the URL to retrieve only tweets. However, if a value is provided for this parameter, the search will be made from the URL `twitter.com/<USERNAME>`.
 
 Read below text extracted from the official Wayback CDX Server API (Beta) documentation.
 
index b00925a6ec8bebb8f764699e5989ec847f6e8de2..64ea35f7f002a02e67f549db48eb8816da91d5d5 100644 (file)
@@ -46,12 +46,12 @@ class WaybackTweets:
         """
         url = "https://web.archive.org/cdx/search/cdx"
 
-        status = "/status/*"
-        if self.matchtype != "exact":
-            status = ""
+        status_pathname = "status/*"
+        if self.matchtype:
+            status_pathname = ""
 
         params = {
-            "url": f"https://twitter.com/{self.username}{status}",
+            "url": f"https://twitter.com/{self.username}/{status_pathname}",
             "output": "json",
         }