Skip to content

Commit

Permalink
Merge pull request #74 from marcelhamel/content-api-update
Browse files Browse the repository at this point in the history
Add inventory param to push_content function
  • Loading branch information
expe authored Jul 29, 2024
2 parents 22aa39b + efc63b0 commit 178e7fe
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions sailthru/sailthru_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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 {}
Expand All @@ -422,6 +423,8 @@ def push_content(self, title, url,
data['location'] = date
if price is not None:
data['price'] = price
if inventory is not None:
data['inventory'] = inventory
if description is not None:
data['description'] = description
if site_name is not None:
Expand Down Expand Up @@ -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
return None

0 comments on commit 178e7fe

Please sign in to comment.