Spaces:
Running
Running
Update get_gmail_data.py
Browse files- get_gmail_data.py +1 -1
get_gmail_data.py
CHANGED
@@ -51,7 +51,7 @@ class GmailDataExtractor:
|
|
51 |
receipt_query = f"(label:^smartlabel_receipt OR (subject:your AND subject:order) OR subject:receipts OR subject:receipt OR subject:invoice OR subject:invoice))"
|
52 |
if self.__user_input is not None:
|
53 |
receipt_query = f"(label:^smartlabel_receipt OR (subject:your AND subject:order) OR subject:receipts OR subject:receipt OR subject:invoice OR subject:invoice)) AND subject:{self.__user_input}"
|
54 |
-
gmail_url = f"https://www.googleapis.com/gmail/v1/users/me/messages?q={receipt_query}"
|
55 |
def __fetch_page(url):
|
56 |
response = requests.get(url, headers={"Authorization": f"Bearer {access_token}"})
|
57 |
response.raise_for_status() # Raise error if the request fails
|
|
|
51 |
receipt_query = f"(label:^smartlabel_receipt OR (subject:your AND subject:order) OR subject:receipts OR subject:receipt OR subject:invoice OR subject:invoice))"
|
52 |
if self.__user_input is not None:
|
53 |
receipt_query = f"(label:^smartlabel_receipt OR (subject:your AND subject:order) OR subject:receipts OR subject:receipt OR subject:invoice OR subject:invoice)) AND subject:{self.__user_input}"
|
54 |
+
gmail_url = f"https://www.googleapis.com/gmail/v1/users/me/messages?q={receipt_query}&maxResults=10"
|
55 |
def __fetch_page(url):
|
56 |
response = requests.get(url, headers={"Authorization": f"Bearer {access_token}"})
|
57 |
response.raise_for_status() # Raise error if the request fails
|