From 0eb0104b22544138897a8924afd381492e4d54d8 Mon Sep 17 00:00:00 2001 From: Marcel Hamel Date: Fri, 26 Jul 2024 09:01:59 -0400 Subject: [PATCH 1/2] add inventory to push_content --- sailthru/sailthru_client.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sailthru/sailthru_client.py b/sailthru/sailthru_client.py index 8164b76..18c344e 100644 --- a/sailthru/sailthru_client.py +++ b/sailthru/sailthru_client.py @@ -386,7 +386,7 @@ def push_content(self, title, url, description=None, location=None, price=None, tags=None, author=None, site_name=None, - spider=None, vars=None): + spider=None, vars=None, inventory=None): """ Push a new piece of content to Sailthru. @@ -407,6 +407,7 @@ def push_content(self, title, url, @param site_name: site name for the content @param spider: truthy value to force respidering content @param vars: replaceable vars dictionary + @param inventory: integer value indicating current item inventory """ vars = vars or {} @@ -422,6 +423,8 @@ def push_content(self, title, url, data['location'] = date if price is not None: data['price'] = price + if data['inventory'] is not None: + data['inventory'] = inventory if description is not None: data['description'] = description if site_name is not None: @@ -789,4 +792,4 @@ def get_last_rate_limit_info(self, action, method): if (action in self.last_rate_limit_info and method in self.last_rate_limit_info[action]): return self.last_rate_limit_info[action][method] - return None \ No newline at end of file + return None From efc63b04508cc5854a4532eb74f5a621bf918608 Mon Sep 17 00:00:00 2001 From: Marcel Hamel Date: Fri, 26 Jul 2024 09:04:45 -0400 Subject: [PATCH 2/2] add inventory to push_content --- sailthru/sailthru_client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sailthru/sailthru_client.py b/sailthru/sailthru_client.py index 18c344e..3180b36 100644 --- a/sailthru/sailthru_client.py +++ b/sailthru/sailthru_client.py @@ -423,7 +423,7 @@ def push_content(self, title, url, data['location'] = date if price is not None: data['price'] = price - if data['inventory'] is not None: + if inventory is not None: data['inventory'] = inventory if description is not None: data['description'] = description