Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Ruby gem for currency conversion based on Open Exchange Rates API - free / open source hourly-updated currency data for everybody
Please see https://github.com/josscrowcroft/open-exchange-rates#accuracy
Add this line to your application's Gemfile:
gem 'open_exchange_rates'
And then execute:
$ bundle
Or install it yourself as:
$ gem install open_exchange_rates
You will need App ID to use OpenExchangeRates, you can get one here for free.
Option 1
Set OPEN_EXCHANGE_RATES_APP_ID environment variable and it will be used automatically. If you are using foreman for example just add it to your .env file like this
OPEN_EXCHANGE_RATES_APP_ID=YourAppID
Option 2
OpenExchangeRates.configure do |config|
config.app_id = "YourAppID"
end
If you are using Rails good place to add this is config/initializers/open_exchange_rates.rb
Option 3
Pass it on initialization
fx = OpenExchangeRates::Rates.new(:app_id => "YourAppID")
Start by creating OpenExchangeRates::Rates instance
fx = OpenExchangeRates::Rates.new
Convert between currencies using current rates
fx.convert(123.45, :from => "USD", :to => "EUR") # => 99.87
Convert between currencies on specific date
fx.convert(123.45, :from => "USD", :to => "EUR", :on => "2012-05-10") # => 95.47
Get current exchange rate
fx.exchange_rate(:from => "USD", :to => "EUR") # => 0.808996
Get exchange rate on specific date
fx.exchange_rate(:from => "USD", :to => "EUR", :on => "2012-05-10") # => 0.773329
If you omit :from or :to option conversion will be related to base currency. USD is set as base currency (plan is to add this as config option in the near future).
fx.convert(123.45, :to => "EUR") # => 99.87 EUR
fx.convert(123.45, :from => "EUR") # => 152.51 USD
fx.exchange_rate(:to => "EUR") # => 0.808996
fx.exchange_rate(:from => "EUR") # => 1.235414
git checkout -b my-new-feature
)git commit -am 'Added some feature'
)git push origin my-new-feature
)cp env.example .env
.env
and enter your API IDrake
This project rocks and uses MIT-LICENSE.
Please check Open Exchange Rates API license and terms also.
FAQs
Unknown package
We found that open_exchange_rates 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
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.