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.
A ruby gem that retrieves real-time stock quotes and historical pricing from google yahoo.
On November 1, 2013, Google discontinued iGoogle, which contained the api endpoint brm_finance utilized, rendering the gem inoperable.
As of November 2nd, 2013, the brm_finance gem has been rebuilt to use the Yahoo finance api, starting with version 1.1.0. All applications leveraging this gem should update to 1.1.0 to resume operation. The gem methods are the same, but responses have been modified to leverage the new api. Documentation has been updated to reflect these changes.
To install the 'brm_finance' ruby gem:
gem install brm_finance
To use the gem in your Rails Application, include it:
Include the gem in config/environments.rb:
config.gem "brm_finance"
Include the gem in your Gemfile:
gem "brm_finance"
You can get a current quote with the following syntax:
stock = BrmFinance::Stock.quote("symbol")
Where symbol equals the company stock symbol you want a quote for. For example, "aapl" for Apple, Inc.
You may search for multiple stocks by separating symbols with a comma. For example:
stocks = BrmFinance::Stock.quote("aapl,tsla")
Or as an array.
stocks = BrmFinance::Stock.quote(["aapl", "tsla"])
These queries will return a Stock object or an array of Stock objects which you may iterate through. Each stock object has the following values:
BrmFinance::Stock.history(symbol, start_date, end_date) is as alias to BrmFinance::Stock.quote(symbol, start_date, end_date).
If you pass quote a start_date and end_date it will do a historical query within the date range as opposed to a realtime quote. Only one stock symbol should be used for historical quotes.
Historical queries provide an array of Price objects with the following values:
Values may be accessed off the Stock or Price object like so:
BrmFinance::Stock.quote("SYMBOL").last
Or:
stock = BrmFinance::Stock.quote("SYMBOL")
stock.last
You can always convert the queries results to json with the following commands:
BrmFinance::Stock.quote("SYMBOL").to_json
Or:
BrmFinance::Stock.history("SYMBOL").to_json
Stock instances now include a response_code: 200 and 404.
> @stock = BrmFinance::Stock.quote('aapl')
> @stock.response_code
=> 200
Additionally, stock instances now have a success? and failure? method.
> @stock.success?
=> true
In the event that a stock symbol is incorrect, the returned instance will provide a response code of 404 and respond in the affirmative to a failure? method call.
> @stock = BrmFinance::Stock.quote('asdf')
> @stock.response_code
=> 404
> @stock.failure?
=> true
...Google Yahoo for making this api publicly available.
Copyright (c) 2011 Ty Rauber
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
FAQs
Unknown package
We found that brm_finance demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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.