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

Added wishlist support #21

Open
lazyhummingbird opened this issue Dec 27, 2020 · 0 comments
Open

Added wishlist support #21

lazyhummingbird opened this issue Dec 27, 2020 · 0 comments

Comments

@lazyhummingbird
Copy link

lazyhummingbird commented Dec 27, 2020

I added functions for getting wishlists (saved lists) and their listings:

    @require_auth
    def get_wishlist(self, wishlist_id):
        """
        Get a wishlist's primary information
        """
        r = self._session.get(API_URL + "/wishlists/" + wishlist_id)
        r.raise_for_status()

        return r.json()

    @require_auth
    def get_wishlist_listings(self, wishlist_id, offset=0, limit=100):
        """
        Get a wishlist's listings
        """
        params = {
            'wishlist_id':str(wishlist_id),
            '_format': 'for_collaborator',
            '_offset': str(offset),
            '_limit': str(limit)
        }

        r = self._session.get(API_URL + "/wishlisted_listings", params=params)
        r.raise_for_status()

        return r.json()

Feel free to add/merge if desired. Just posting here to help in case others want it.

Thanks for a great library! Helped me plan a fantastic escape for my girl and I.

This was referenced Mar 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant