Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

wishsimple

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

wishsimple

  • 0.0.1
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

WishSimple

Ruby wrapper for the WishSimple API

WishSimple provides gift recommendations as a service. It's currently in private beta and you can request an API key here.

Installation

gem install wishsimple

Authentication

If you're using Rails, you may want to add the following to config/initializers/wishsimple.rb:

WishSimple.configure do |config|
  config.api_key = '<your API key>'
end

You can also set the key directly:

WishSimple.api_key = '<your API key>'

Usage

WishSimple uses a Facebook user's interactions with products to generate gift recommendations. Currently, only purchases are supported, though more types of interactions will be supported in the near future (e.g. ratings, adding to a wish list, etc.).

To begin, you'll need the following data:

  • facebook_uid - The Facebook user's numerical UID
  • access_token - The Facebook user's OAuth access token (see "Permissions" below)
  • product_uid - Whatever you use to identify the product; usually the database ID

Recording a purchase is as easy as:

user = WishSimple::User.create(facebook_uid, access_token)
product = WishSimple::Product.create(product_uid)
user.purchase!(product)

You can interact with objects as you would expect:

user = WishSimple::User.new(facebook_uid)
user.access_token = access_token
user.save

purchase = WishSimple::Purchase.new
purchase.user = user
purchase.product = product
purchase.save

You can delete data like so:

# Purchases
purchase = WishSimple::Purchase.new(user: user, product: product)
purchase.destroy

# Users (this will also delete the user's purchases)
user = WishSimple::User.new(facebook_uid)
user.destroy

# Products (this will also delete the product's purchases)
product = WishSimple::Product.new(product_uid)
product.destroy

Permissions

You'll want to request the following Facebook permissions when generating the access token:

user_birthday, user_interests, user_likes

Gift Recommendations

Here's a funny riddle:

Q: What kind of gift recommendation service doesn't actually have the ability to request the gift recommendations?
A: One that's in private beta.

Okay, that was terrible, but jokes aside, we're working hard to make the gift recommendations awesome. You can expect them soon.

Copyright (c) 2012 Shaun Chapman and WishSimple, Inc. See LICENSE for details.

FAQs

Package last updated on 15 Jun 2012

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc