Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/aqlx86/karensi
PHP Library for fixer.io foreign exchange rates and currency conversion.
https://github.com/aqlx86/karensi
Last synced: 29 days ago
JSON representation
PHP Library for fixer.io foreign exchange rates and currency conversion.
- Host: GitHub
- URL: https://github.com/aqlx86/karensi
- Owner: aqlx86
- Created: 2016-03-07T11:32:42.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2016-06-08T07:04:15.000Z (over 8 years ago)
- Last Synced: 2024-05-01T13:24:00.091Z (8 months ago)
- Language: PHP
- Homepage:
- Size: 17.6 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Karensi
[![Build Status](https://travis-ci.org/aqlx86/karensi.svg?branch=master)](https://travis-ci.org/aqlx86/karensi)
PHP Library for fixer.io foreign exchange rates and currency conversion.
## Installation
```
> composer.phar require aqlx86/karensi
> composer.phar install
```## Usage
Fetch all
```
$karensi = new Karensi\Karensi('USD');
$rates = $karensi->fetch_rate();
```Fetch specific currencies
```
$karensi = new Karensi\Karensi('USD', ['CAD', 'PHP']);
$rates = $karensi->fetch_rate();
```Fetch historical rates
```
$karensi = new Karensi\Karensi('USD', ['CAD', 'PHP'], '2015-12-28');
$rates = $karensi->fetch_rate();
```Save fetched rates in json format
```
$karensi->save('./rates/');
```## Test
```
./bin/phpspec run
```