Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/shakaran/riskpremium
⚡️ :bar_chart: A easy PHP API class for follow the main values of Risk Premium on Europe.
https://github.com/shakaran/riskpremium
Last synced: about 21 hours ago
JSON representation
⚡️ :bar_chart: A easy PHP API class for follow the main values of Risk Premium on Europe.
- Host: GitHub
- URL: https://github.com/shakaran/riskpremium
- Owner: shakaran
- Created: 2012-06-01T08:43:15.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2021-08-31T14:26:49.000Z (over 3 years ago)
- Last Synced: 2024-11-15T22:40:29.092Z (about 2 months ago)
- Language: PHP
- Homepage:
- Size: 4.88 KB
- Stars: 4
- Watchers: 5
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
- Funding: .github/FUNDING.yml
Awesome Lists containing this project
README
[![No Maintenance Intended](http://unmaintained.tech/badge.svg)](http://unmaintained.tech/)
Risk premium is a easy PHP API class for follow the main values of Risk premium
on Europe.It is mainly used on Twitter bot @PrimaRiesgoBot_ https://twitter.com/PrimaRiesgoBot_
It is a improved version with more details of @PrimaRiesgoBot (without underscore).
It support also get the data for other european countries like:
* Ireland
* Portugal
* Finland
* Austria
* Holland
* Spain
* France
* Italy
* GreeceAs twitter bot uses twitteroauth https://github.com/abraham/twitteroauth
tweeting the values obtained.Risk premium is licensed under AGPLv3 http://www.gnu.org/licenses/agpl-3.0.html
The code is autodocumented with php-doc syntax and some examples at the end.
Some examples
-----------// Init the class
$risk_premium = new RiskPremium();
// Get data without keys for each country or specify value for normal behaviour
$risk_premium_ireland = $risk_premium->getIreland();
$risk_premium_portugal = $risk_premium->getPortugal();
$risk_premium_finland = $risk_premium->getFinland();
$risk_premium_belgium = $risk_premium->getBelgium();
$risk_premium_austria = $risk_premium->getAustria();
$risk_premium_holland = $risk_premium->getHolland();
$risk_premium_spain = $risk_premium->getSpain('value');
$risk_premium_france = $risk_premium->getFrance();
$risk_premium_italy = $risk_premium->getItaly();
$risk_premium_greece = $risk_premium->getGreece();
// Show the data. See on Spain other interested data with other keys
echo 'Ireland: ' . $risk_premium_ireland . '
' .
'Portugal: ' . $risk_premium_portugal . '
' .
'Finland: ' . $risk_premium_finland . '
' .
'Belgium: ' . $risk_premium_belgium . '
' .
'Austria: ' . $risk_premium_austria . '
' .
'Holland: ' . $risk_premium_holland . '
' .
'Spain: ' . $risk_premium_spain . ' Diff: ' . $risk_premium->getSpain('difference') .
' % ' . $risk_premium->getSpain('percentage') .
' Max year: ' . $risk_premium->getSpain('max_year') .
' Min year: ' . $risk_premium->getSpain('min_year') .'
' .
'France: ' . $risk_premium_france . '
' .
'Italy: ' . $risk_premium_italy . '
' .
'Greece: ' . $risk_premium_greece . '
';Risk premium accept pull request or issues if you want improve or change something.
For more info:
* Risk premium: http://en.wikipedia.org/wiki/Risk_premium
* Von Neumann–Morgenstern utility theorem: http://en.wikipedia.org/wiki/Von_Neumann%E2%80%93Morgenstern_utility_theorem