Official International Name days API library

Overview

Official International Name days API library

Name day API library for nameday.abalin.net

This library makes it easy to send requests towards nameday.abalin.net API. API provides name days for various countries.

Installation

The recommended way to install package is through Composer.

# Install Composer
curl -sS https://getcomposer.org/installer | php

Next, run the Composer command to install the latest stable version of package:

composer require xnekv03/nameday-api

After installing, you need to require Composer's autoloader:

require 'vendor/autoload.php';

You can then later update package using composer:

composer update

List of supported countries

Constantly adding new Country codes, please check nameday.abalin.net for updated list.

When using country codes in the library you can use either country names or country codes.

  • Country names
    • United States
    • Czech Republic
    • Slovakia
    • Poland
    • France
    • Hungary
    • Croatia
    • Sweden
    • Austria
    • Italy
    • Germany
    • Spain
  • Country codes
    • us
    • cz
    • sk
    • pl
    • fr
    • hu
    • hr
    • se
    • at
    • it
    • de
    • es

Usage

create an instance of the class
$nameday = new Nameday();
$nameday = new Nameday('America/Vancouver'); # time zone specification, other then system default (see below)
Request name days for today / tomorrow / yesterday
tomorrow(); # {"data":{"day":28,"month":8,"name_us":"Agustin, August, Augusta ... }} echo $nameday->yesterday(); # {"data":{"day":26,"month":8,"name_us":"Percival, Percy ... }}">
echo $nameday->today(); # {"data":{"day":27,"month":8,"name_us":"Caesar, Cesar ... }}
echo $nameday->tomorrow(); # {"data":{"day":28,"month":8,"name_us":"Agustin, August, Augusta ... }}
echo $nameday->yesterday(); # {"data":{"day":26,"month":8,"name_us":"Percival, Percy ... }}
Request name days for today / tomorrow / yesterday for specific country only
today('Slovakia'); # {"data":{"day":27,"month":8,"name_sk":"Silvia"}} echo $nameday->tomorrow('at'); # {"data":{"day":28,"month":8,"name_at":"Adelinde, Aline, Augustin"}} echo $nameday->tomorrow('Austria'); # {"data":{"day":28,"month":8,"name_at":"Adelinde, Aline, Augustin"}} echo $nameday->yesterday('de'); # {"data":{"day":26,"month":8,"name_de":"Margarita, Miriam, Patricia, Teresa"}} echo $nameday->yesterday('Germany'); # {"data":{"day":26,"month":8,"name_de":"Margarita, Miriam, Patricia, Teresa"}}">
echo $nameday->today('sk'); # {"data":{"day":27,"month":8,"name_sk":"Silvia"}}
echo $nameday->today('Slovakia'); # {"data":{"day":27,"month":8,"name_sk":"Silvia"}}

echo $nameday->tomorrow('at'); # {"data":{"day":28,"month":8,"name_at":"Adelinde, Aline, Augustin"}}
echo $nameday->tomorrow('Austria'); # {"data":{"day":28,"month":8,"name_at":"Adelinde, Aline, Augustin"}}

echo $nameday->yesterday('de'); # {"data":{"day":26,"month":8,"name_de":"Margarita, Miriam, Patricia, Teresa"}}
echo $nameday->yesterday('Germany'); # {"data":{"day":26,"month":8,"name_de":"Margarita, Miriam, Patricia, Teresa"}}
Request name days for specific date

specificDay(int $day, int $month, string $countryCode)

echo $nameday->specificDay(21,10); # {"data":{"day":21,"month":10,"name_us":"Celina, Celine, Nobel" ... }}
Request name days for specific date and for specific country only

simply add optional third string parameter $countryCode, which must be one of the supported country codes

specificDay(29,3,'Spain'); # {"data":{"day":29,"month":3,"name_es":"Jonas, Segundo"}} echo $nameday->specificDay(2,12,'de'); # {"data":{"day":2,"month":12,"name_de":"Bibiana, Jan, Lucius"}} echo $nameday->specificDay(2,12,'Germany'); # {"data":{"day":2,"month":12,"name_de":"Bibiana, Jan, Lucius"}} echo $nameday->specificDay(12,1,'pl'); # {"data":{"day":22,"month":1,"name_pl":"Anastazy, Dobromysł, Dorian, Marta, Wincenty"}} echo $nameday->specificDay(12,1,'Poland'); # {"data":{"day":22,"month":1,"name_pl":"Anastazy, Dobromysł, Dorian, Marta, Wincenty"}} echo $nameday->specificDay(2,2,'hr'); # {"data":{"day":2,"month":2,"name_hr":"Marijan"}} echo $nameday->specificDay(2,2,'Croatia'); # {"data":{"day":2,"month":2,"name_hr":"Marijan"}}">
echo $nameday->specificDay(29,3,'es'); # {"data":{"day":29,"month":3,"name_es":"Jonas, Segundo"}}
echo $nameday->specificDay(29,3,'Spain'); # {"data":{"day":29,"month":3,"name_es":"Jonas, Segundo"}}

echo $nameday->specificDay(2,12,'de'); # {"data":{"day":2,"month":12,"name_de":"Bibiana, Jan, Lucius"}}
echo $nameday->specificDay(2,12,'Germany'); # {"data":{"day":2,"month":12,"name_de":"Bibiana, Jan, Lucius"}}

echo $nameday->specificDay(12,1,'pl'); # {"data":{"day":22,"month":1,"name_pl":"Anastazy, Dobromysł, Dorian, Marta, Wincenty"}}
echo $nameday->specificDay(12,1,'Poland'); # {"data":{"day":22,"month":1,"name_pl":"Anastazy, Dobromysł, Dorian, Marta, Wincenty"}}

echo $nameday->specificDay(2,2,'hr'); # {"data":{"day":2,"month":2,"name_hr":"Marijan"}}
echo $nameday->specificDay(2,2,'Croatia'); # {"data":{"day":2,"month":2,"name_hr":"Marijan"}}
Request name day in country calendar

Will return all days in given calendar which contains the name.

searchByName(string $day, string $countryCode)

Both parameters are required. Parameter $countryCode must be one of the supported country codes

searchByName('Jan','Czech Republic'); # {"calendar":"cz","results":[{"day":24,"month":5,"name":"Jana"},{"day":24,"month":6,"name":"Jan"} ... }}">
echo $nameday->searchByName('Jan','cz'); # {"calendar":"cz","results":[{"day":24,"month":5,"name":"Jana"},{"day":24,"month":6,"name":"Jan"} ... }}
echo $nameday->searchByName('Jan','Czech Republic'); # {"calendar":"cz","results":[{"day":24,"month":5,"name":"Jana"},{"day":24,"month":6,"name":"Jan"} ... }}

Specification of time zone

Time zone is set by local php.ini settings. Therefore $nameday->today() will return result according to that. If you need to specify different time zone you can do so by adding optional parameter $timeZone to the constructor. $timeZone must be PHP time zones string or integer offset to GMT.

$nameday = new Nameday('Pacific/Honolulu');
echo $nameday->today(); # will return today name days according to Pacific/Honolulu time zone
$nameday = new Nameday('+13:30');
echo $nameday->tomorrow(); # will return today name days according to given UTC offset

Certificate

Make sure you have proper certificates stored on your local machine as Name day API uses HTTPS only.

If you run into problems with server certificate try downloading the The Mozilla CA certificate store, save it on your system and configure php.ini

[curl]
; A default value for the CURLOPT_CAINFO option. This is required to be an
; absolute path.
curl.cainfo ="C:\...\cacert.pem"
You might also like...
The official Previewify.app PHP Client
The official Previewify.app PHP Client

Previewify for PHP This is the official Previewify client for PHP. Support us Like our work? You can support us by purchasing one of our products. Ins

OpenAI API Client is a component-oriented, extensible client library for the OpenAI API. It's designed to be faster and more memory efficient than traditional PHP libraries.

OpenAI API Client in PHP (community-maintained) This library is a component-oriented, extensible client library for the OpenAI API. It's designed to b

BeckhoffPLCSoapClient - SoapClient to communicate with BeckHoff PLC. Library made in PHP based on TcAdsWebService JavaScript Library.

BeckhoffPLCSoapClient - SoapClient to communicate with BeckHoff PLC. Library made in PHP based on TcAdsWebService JavaScript Library.

PHP library for the Stripe API.

Stripe PHP bindings The Stripe PHP library provides convenient access to the Stripe API from applications written in the PHP language. It includes a p

A PHP library for communicating with the Twilio REST API and generating TwiML.

twilio-php The default branch name for this repository has been changed to main as of 07/27/2020. Documentation The documentation for the Twilio API c

A PHP library for the Campaign Monitor API

createsend A PHP library which implements the complete functionality of the Campaign Monitor API. Installation Composer If you use Composer, you can r

PHP 5.3+ library which helps you to interact with the DigitalOcean API

DigitalOcean The version 2 of the API will be available soon ! Please visit DigitalOceanV2 and contribute :) This PHP 5.3+ library helps you to intera

PHP library for the GitHub API v3

GitHub API v3 - PHP Library Currently under construction. Overview Provides access to GitHub API v3 via an Object Oriented PHP library. The goal of th

PHP library to use IOTA REST API to help node management and tangle queries

iota.php About PHP library to use IOTA REST API to help node management and tangle queries. Please be aware that this library is in an early developme

Comments
  • Update guzzlehttp/guzzle to 7v

    Update guzzlehttp/guzzle to 7v

    Cannot install via composer when using the 7v of the guzzlehttp/guzzle

    Problem 1 - Root composer.json requires xnekv03/nameday-api ^2.0 -> satisfiable by xnekv03/nameday-api[v2.0.0]. - xnekv03/nameday-api v2.0.0 requires guzzlehttp/guzzle ^6.5 -> found guzzlehttp/guzzle[6.5.0, ..., 6.5.x-dev] but it conflicts with your root composer.json require (^7.0.1).

    opened by jadamec 1
  • Inluding data problem

    Inluding data problem

    Hello, including data file file_get_contents('src/nameday/data/countryList.json') depends on working directory, better will be use something like file_get_contents(__DIR__ . '/data/countryList.json')

    opened by leninzprahy 1
  • Folder name case problem

    Folder name case problem

    Hello, i found problem on linux system, in composer.json in autoload section is src/Nameday/ but the folder name is src/nameday/ (lowercase "n") and php can't found the class.

    opened by leninzprahy 1
Releases(v3.0.0)
Owner
VojtaN
VojtaN
reenom domain name renews automatically.

reenom domain name renews automatically.

null 2.5k Jan 7, 2023
PHP Telegram Bot based on the official Telegram Bot API with iTelegram Class.

iTelegram PHP Telegram Bot based on the official Telegram Bot API Bots: An introduction for developers Bots are special Telegram accounts designed to

iNeoTeam | آی نئو 5 Nov 9, 2022
A PHP client for the official Kizeo Forms API V3+. 📌

Kizeo Forms API V3+ - PHP This is a Swagger generated doc for Kizeo REST API 3. You can find additionnal documentation here : Online documentation. Th

siapepfrance 1 Oct 26, 2021
Official PHP SDK for interacting with the Knock API.

Knock PHP library Documentation See the documentation for PHP usage examples

Knock 4 Dec 16, 2022
PHP Telegram Bot based on the official Telegram Bot API

PHP Telegram Bot based on the official Telegram Bot API

null 4 Dec 8, 2021
The Official Vultr API PHP Wrapper

WIP - This is not the final API Client. Unstable release use with caution. Vultr API PHP Client. Getting Started Must have a PSR7, PSR17, and PSR18 Co

Vultr 10 Dec 20, 2022
Official repository of the AWS SDK for PHP (@awsforphp)

AWS SDK for PHP - Version 3 The AWS SDK for PHP makes it easy for developers to access Amazon Web Services in their PHP code, and build robust applica

Amazon Web Services 5.7k Jan 1, 2023
Mailgun's Official SDK for PHP

Mailgun PHP client This is the Mailgun PHP SDK. This SDK contains methods for easily interacting with the Mailgun API. Below are examples to get you s

Mailgun Team 1k Dec 23, 2022
The official PHP SDK for Webmarketer (app.webmarketer.io)

PHP SDK for Webmarketer The official PHP SDK for Webmarketer (app.webmarketer.io). Install To add this package, your project must meet several require

Webmarketer 5 Dec 13, 2021
AltiriaSmsPhpClient, the official PHP client of Altiria

Altiria, cliente SMS PHP Altiria SMS PHP es un cliente que simplifica al máximo la integración de nuestro API para PHP. Por el momento, esta librería

Altiria 3 Dec 22, 2022