The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Religion::Islam::PrayMind - a Perl module that is a client for PrayerMinder server

SYNOPSIS

  use Religion::Islam::PrayMind;

  
  $p1 = new PMConnect(ClientID => "xxxx");
  #where xxxx is the client web site's ID at the PrayerMinder server.

  $p1->GetList(<listtype> [, <parentID>);
  $p1->GetPrayerTimes(<cityID>);

DESCRIPTION

This module provides ways to obtain data from the PrayerMinder server. It is built on top of XML::Parser. Each call to GetList or GetPrayerTimes methods opens a socket connection to the PrayerMinder server, and creates a new instance of XML::Parser which is then used to parse the data received through the socket.

Example

The following files show example usage of the PrayMind module:

- ContinentsList.pl
- CountriesList.pl
- CitiesList.pl
- CityTimes.pl

EXPORT

Exported constants and variables

  • Version of the module.

    . $VERSION
  • LIST_TYPE

    . eContinentsList
    . eCountriesList
    . eStatesList
    . eCitiesListForState
    . eCitiesListForCountry
    . ePrayerTimes
    . ePrayerTimeTable
  • Error_ID

    . IDS_NO_Error
    . IDS_ERROR_OpenNotCalled
    . IDS_ERROR_ClientIDNotSpecified
    . IDS_ERROR_EmptyString
    . IDS_ERROR_GetListNotCalled
    . IDS_ERROR_GetPrayerTimesNotCalled
    . IDS_ERROR_EmptyList

METHODS

new(ClientID => "CLIENTID")

This is a class method, the constructor for PMConnect. Client ID for the caller's PrayerMinder account is passed as keyword value pair.

GetList(LIST_TYPE [, PARENT_ID])

This method retrieves a list of locations.

PARAMETERS

  • LIST_TYPE

    Specifies type of list desired. The properties and elementes of the list can be retrieved using relevant methods listed later. GetError and GetErrorText must be called before calling any other methods to make sure no errors occurred. Possible values for LIST_TYPE are listed below:

    . eContinentsList
    . eCountriesList
    . eStatesList (not yet implemented)
    . eCitiesListForState (not yet implemented)
    . eCitiesListForCountry
    . eCitiesSearchList (not yet implemented)
  • PARENT_ID

    Not needed if LIST_TYPE is eContinentsList, required otherwise. Specifies the parent whose children are to be listed.

GetListSize

Returns integer

Called after GetList to obtain the number of locations in the list.

GetElementID

Returns integer

Called after GetList to obtain the number of locations in the list.

GetElementName

Returns string

Called after GetList to obtain the number of locations in the list.

NextElement

Returns true if successful, false for no more elements.

Called after GetList to obtain the number of locations in the list.

GetPrayerTimes(CITY_ID)

This method retrieves prayer times for the requested city. CITY_ID specifies the ID of the city requested. GetError and GetErrorText must be called before calling any other methods to make sure no errors occurred.

CityID

Returns integer

Called after GetPrayerTimes to obtain the ID for the city.

CityTitle

Returns string

Called after GetPrayerTimes to obtain the title for the city.

CityTimeZone

Returns string (floating point decimal number)

Called after GetPrayerTimes to obtain the time zone for the city.

CityIslamicDate

Returns string

Called after GetPrayerTimes to obtain today's Islamic date for the city.

CityGregorianDate

Returns string

Called after GetPrayerTimes to obtain today's Gregorian date for the city.

CityAsrFiqh

Returns string

Called after GetPrayerTimes to obtain the default Asr fiqh method for the city.

CityPrayerTime(PRAYER_NAME)

Returns string

Called after GetPrayerTimes to obtain the requested prayer time for the city.

PARAMETERS

  • PRAYER_NAME

    Specifies prayer whose time is desired. Possible values for PRAYER_NAME are listed below:

    . Fajr
    . Shurooq
    . Zuhr
    . AsrHanafi
    . AsrShafei
    . Maghrib
    . Isha
GetError

Returns Error_ID

Called after GetPrayerTimes or GetList to obtain the error ID. Returns values indicates error ID or IDS_NoError if no errors occurred.

GetErrorText

Returns string

Called after GetError to obtain the text description of the last error.

AUTHOR

Tasmin Ahmad, <support@prayerminder.com>

Web site: http://www.prayerminder.com/