From: Claromes Date: Sun, 16 Jun 2024 00:23:09 +0000 (-0300) Subject: update status_pathname X-Git-Url: https://git.claromes.com/?a=commitdiff_plain;h=e9f2ecca407ab062e880c35ccc8a7a78cb1df2ae;p=waybacktweets.git update status_pathname --- 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", }