Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
This library provides a wrapper to the eBay APIs.
You can instantiate API requests using shorthand class methods defined on Ebay
.
Ebay.finding # returns a new Ebay::Finding instance
eBay APIs require developer keys.
You can provide these globally with the environment variables EBAY_APP_ID
, EBAY_DEV_ID
, and EBAY_CERT_ID
.
If you prefer not to use environment variables, you can provide your keys globally with:
Ebay.configure do |config|
config.app_id = 'YOUR APP ID'
config.dev_id = 'YOUR DEV ID'
config.cert_id = 'YOUR CERT ID'
end
Finally, you can provide your keys individually to the request when instantiating it. This is what you will want to do if you are using multiple sets of credentials.
Please note that each API names keys differently.
request = Ebay.finding(security_appname: 'YOUR APP ID')
In the examples below, we will assume we are providing our keys with environment variables.
The eBay APIs return responses in XML or JSON format.
You can override the default format of an API when instantiating the request.
require 'json'
### the Finding API returns XML by default
request = Ebay.finding(response_data_format: 'JSON')
response = request.find_items_by_keywords('iphone')
JSON.parse(response)
The Browse API allows your buyers to search eBay items by keyword and category. It also allows them to view and add items to their eBay shopping cart. The Browse API defaults to the eBay US marketplace but may be set during initialisation. The list of available marketplaces is here.
Note The marketplace value needs to use an underscore between EBAY and the country code. The Finding and Merchandising APIs use a hyphen.
require 'ebay/browse'
require 'ebay/oauth/client_credentials_grant'
access_token = Oauth::ClientCredentialsGrant.new.mint_access_token
request = Ebay.browse(campaign_id: '123', country: 'US', zip: '19406',
access_token: access_token, market_id: 'EBAY_US')
response = request.search(q: 'iphone')
The Finding API lets you search and browse for items listed on eBay and provides useful metadata to refine searches.
require 'ebay/finding'
request = Ebay.finding
response = request.find_items_by_keywords('iphone')
The Merchandising API retrieves information about products or item listings on eBay to help you sell more merchandise to eBay buyers.
require 'ebay/merchandising'
request = Ebay::Merchandising.new
response = request.get_most_watched_items
The eBay Shopping API makes it easy to search for things on eBay.
require 'ebay/shopping'
request = Ebay::Shopping.new
response = request.find_products('QueryKeywords' => 'tolkien')
eBay has country bsaed marketplaces ( listed here ). By default, the eBay gem queries the US Marketplace. To change the marketplace, set the marketplace on the request object.
Note For the Browse API, the marketplace value needs to use an underscore between EBAY and the country code (EBAY_AU). The Finding and Merchandising APIs require a hyphen between EBAY and the country code ( EBAY-AU )
To write requests and responses to a logger, use the logging feature:
require 'logger'
request = request.use(logging: {logger: Logger.new(STDOUT)})
FAQs
Unknown package
We found that ebay-ruby demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.