From e9f2ecca407ab062e880c35ccc8a7a78cb1df2ae Mon Sep 17 00:00:00 2001 From: Claromes Date: Sat, 15 Jun 2024 21:23:09 -0300 Subject: [PATCH] update status_pathname --- docs/cli.rst | 2 +- waybacktweets/api/request_tweets.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/cli.rst b/docs/cli.rst index 0d6b8f3..f6f19fc 100644 --- a/docs/cli.rst +++ b/docs/cli.rst @@ -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/`. Read below text extracted from the official Wayback CDX Server API (Beta) documentation. diff --git a/waybacktweets/api/request_tweets.py b/waybacktweets/api/request_tweets.py index b00925a..64ea35f 100644 --- a/waybacktweets/api/request_tweets.py +++ b/waybacktweets/api/request_tweets.py @@ -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", } -- 2.34.1