
Security News
Nx npm Packages Compromised in Supply Chain Attack Weaponizing AI CLI Tools
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.
= GMoney
A gem for interacting with the Google Finance API
== Install
gem install gmoney
== Usage
GMoney::GFSession.login('google username', 'password')
Reading > portfolios = GMoney::Portfolio.all #returns all of a user's portfolios > portfolio = GMoney::Portfolio.find(9) #returns a specific portfolio
> positions = portfolio.positions #returns an Array of the Positions held within a given portfolio
Creating > portfolio = GMoney::Portfolio.new > portfolio.title = "My New Portfolio" > portfolio.save #returns portfolio object
Updating > portfolio = GMoney::Portfolio.find 9 > portfolio.title = "My Updated Portfolio Title" > portfolio.save #returns portfolio object
Deleting > GMoney::Portfolio.delete 2
or
> portfolio = GMoney::Portfolio.find 2
> portfolio.delete #call delete on an instance of a portfolio
Reading > positions = GMoney::Position.find(9) #returns all of a user's positions within a given portfolio, i.e. Portfolio "9" > position = GMoney::Position.find("9/NASDAQ:GOOG") #returns a specific position within a given portfolio
> transactions = position.transactions #returns an Array of the Transactions within a given position
Creating/Updating Positions are created/updated via transactions
Deleting > GMoney::Position.delete '2/NASDAQ:GOOG'
or
> position = GMoney::Position.find '2/NASDAQ:GOOG'
> position.delete #call delete on an instance of a position
Reading > transactions = GMoney::Transaction.find("9/NASDAQ:GOOG") #returns all of a user's transactions within a given position > transaction = GMoney::Transaction.find("9/NASDAQ:GOOG/2") #returns a specific transaction within a given position
Creating > transaction = GMoney::Transaction.new > transaction.portfolio = 9 #Must be a valid portfolio id > transaction.ticker = 'nyse:c' #Must be a valid ticker symbol > transaction.type = GMoney::BUY #Must be one of the following: Buy, Sell, Sell Short, Buy to Cover > transaction.save #returns transaction object
Updating > transaction = GMoney::Transaction.find('9/NYSE:C/1') > transaction.shares = 50 > transaction.price = 3.50 > transaction.save #returns transaction object
Note: While updating transactions it is not possible to change the portfolio or ticker property as these values are used
by Google to identify specific transactions.
Deleting > GMoney::Transaction.delete '2/NASDAQ:GOOG/1'
or
> transaction = GMoney::Transaction.find '2/NASDAQ:GOOG/1'
> transaction.delete #call delete on an instance of a transaction
Options parameter
The following methods: Portfolio.all Portfolio.find portfolio.positions #where portfolio is an instance of the Portfolio class
Position.find
position.transactions #where position is an instance of the Position class
Transaction.find
all take a hash as an optional last parameter. Valid values for this hash are:
There are still some rough edges. Feedback is appreciated.
== License
(The MIT License)
Copyright (c) 2010 Justin Spradlin
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 gmoney 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.
Security News
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.
Security News
CISA’s 2025 draft SBOM guidance adds new fields like hashes, licenses, and tool metadata to make software inventories more actionable.
Security News
A clarification on our recent research investigating 60 malicious Ruby gems.