Events and Feasts



This API provides the next 5 days of Syro Malabar Events, along with links to the explanation of most events by clicking on them.

 


Link the Script File

Add the below line in the <head> tag of your website.
You only need to add the below line only once per webpage, in case if you have implemented other widgets in the same webpage.

<script src="https://syrocalendar.tk/API/SyroCalendar.min.1.0.2.js"></script>

Place the Div

Paste the below code in the <body> tag of your website, where you need the information to be shown.

Choose either one of the below API calls.


1) To Place the information in a table format (2 columns with Date on First Column, and Event Title on the Second Column).

<div id="SyroCalendar_Events_TableForm">Loading...</div>

OR


2) To Place the information in a Line by Line format (Date on one line, Event on next line)

<div id="SyroCalendar_Events_LineForm">Loading...</div>


Call the API

Choose either one of the below API calls (based on the one you implemented on the above step), and place the below code anywhere after the above div’s are placed.


1) Paste the below line if you chose to show in a table format

<script>SyroCalendar_GetEvents_TableForm();</script>

OR


2) Paste the below line if you chose to show in a Line by Line format

<script>SyroCalendar_GetEvents_LineForm();</script>



Result

You will receive todays seasonal name in the following div’s :

DivDetail
SyroCalendar_Events_TableFormLists 5 Days of upcoming Syro Malabar Feasts / Events in a Tabular Format
SyroCalendar_Events_LineFormLists 5 Days of upcoming Syro Malabar Feasts / Events in a Line by Line Format


Example Code


<html>
<head>
	<title>SyroCalendar Demo - Seasonal Events</title>
	<script src="https://syrocalendar.tk/API/SyroCalendar.min.1.0.1.js"></script>
</head>

<body>
	<div id="SyroCalendar_Events">Loading...</div>
	<br>
	<em>Powered by <a href="https://SyroCalendar.tk" target="_blank">SyroCalendar</a></em>
	<script>SyroCalendar_GetEvents_LineForm();</script>
</body>
</html>

Please don’t forget to provide a link to SyroCalendar.tk below the Widget you implemented. It could be as simple as
Powered by SyroCalendar
(If you have multiple widgets on the same page, just 1 link will suffice)



ADVANCED



To get the JSON Data

To get the JSON data (without HTML Elements), make sure you have the Script file in the <head> tag, and call the below JavaScript function. This function returns a JSON Array of Objects.

<script>var CalendarEvents = GetEventsJSON();</script>


JSON Result

You will get the following data in each JSON Object :

DivDetail
DayTypeType of Event Day – Refer to the Constant Values Page
EventDateDate of the Event
EventTitle_EngEvent Title in English
EventTitle_MalEvent Title in Malayalam
LinkURLLink to the Explanation of the Event / Feast
SeasonIDSeason ID – Refer to the Constant Values Page
TimeStampTime Stamp of the Day
WeeksNumber_EngWeek Number with Day in English
WeeksNumber_MalWeek Number with Day in Malayalam

JSON Example Code


<html>
<head>
	<title>SyroCalendar Demo - Calendar Events</title>
	<script src="https://syrocalendar.tk/API/SyroCalendar.min.1.0.2.js"></script>
</head>

<body>

   <div id="LiturgicalCalendar">Loading...</div>
   
   <script>
		
		var SyroCalendartimer;
		function checkSyroFlag() 
		{
			var CalendarEvents = GetEventsJSON();
			if(!CalendarEvents.hasOwnProperty('Error'))
			{
				var CalendarElement =  document.getElementById('LiturgicalCalendar');
				if (typeof(CalendarElement) != 'undefined' && CalendarElement != null)
				{
					CalendarElement.innerHTML = "The Next Event is : " + CalendarEvents[0].EventTitle_Eng + ". <br> To know more about the event, visit : " + CalendarEvents[0].LinkURL;
				}
				clearTimeout(SyroCalendartimer);
			}
			else{
				SyroCalendartimer = setTimeout(checkSyroFlag, 100); 
			}
		}

		jQuery(window).on('load', function() {
			SyroCalendartimer = setTimeout(checkSyroFlag, 100);
		});
		
	</script>
	<br>
	<em>Powered by <a href="https://SyroCalendar.tk" target="_blank">SyroCalendar</a></em>
</body>
</html>

Please don’t forget to provide a link to SyroCalendar.tk below the Widget you implemented. It could be as simple as
Powered by SyroCalendar
(If you have multiple widgets on the same page, just 1 link will suffice)