Omkar008 commited on
Commit
3f50e38
1 Parent(s): d791119

Update get_gmail_data.py

Browse files
Files changed (1) hide show
  1. 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