
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.
= kiva -- wrapper to the kiva rest API
This is a wrapper to the Kiva Web API. You can find more information about the API here[http://developers.wiki.kiva.org/KivaAPI].
== Example
The following is an example of retrieving the last 20 loans on Kiva. This is about as difficult as things get:
require 'kiva'
newest = Kiva::Loan.load_newest
newest.each{ |loan|
puts "#{loan.name} loaned $#{loan.funded_amount} for
#{loan.activity} in #{loan.location["country"]}"
}
Running the above script yields something similar to the following:
$ ruby -rubygems examples/newest.rb
Angela Okosun loaned $225 for Cement in Nigeria
Vitaliy Konovalenko loaned $1650 for Retail in Ukraine
(...)
Thi Thoa Do's Group loaned $300 for Food Production/Sales in Viet Nam
Thi Hoa Nguyen loaned $900 for General Store in Viet Nam
== Prerequisites
Kiva doesn't require an account or an API key in order to use their API, so there are no prerequisites to using it. This library does depend on SimpleHTTP[http://simplehttp.rubyforge.org/] and json[http://json.rubyforge.org/] to handle the web api. These should be installed automatically if you used +gem+ to install the library, else, you'll need to install them manually.
== Basic Usage
This library consists of number of classes modelling the data objects which the web api returns. Each class is similar, consisting of class methods used to call webapi functions and attributes which provide access to the (unpacked) json data the webapi returns.
These classes are (in no particular order) :
Kiva::Loan
Kiva::Lender
Kiva::LendingAction
Kiva::Partner
Kiva::JournalEntry
Kiva::Comment
Kiva::Release
Each of these classes has attributes containing the data returned from the web api. For example, a +Comment+ has the attributes:
author
body
date
id
whereabouts
Each class has one or more class methods, corresponding to web api calls, which may be used to create and load instances of the class. For example, +Loan+ has the following list of class methods:
== Installing
You should be able to gem install kiva
. Alternatively, download a distribution
at rubyforge: http://rubyforge.org/frs/?group_id=8034
Finally you can grab the sources from the rubyforge or github repositories:
git clone git://rubyforge.org/kiva.git
or
http://github.com/a2800276/kiva/tree/master#
== Mailing List
In case you discover bugs, spelling errors, offer suggestions for improvements or would like to help out with the project, you can contact me directly (tim@kuriositaet.de).
FAQs
Unknown package
We found that kiva 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.