Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add inventory param to push_content function #74

Merged
merged 2 commits into from
Jul 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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