This is API for web resources that are scraped and distributed from following sites;
Following knowledge in your favorable language is expected:
- Sending http requests and receiving data.
- Working with json data.
The hosted api can currently be accessed without any authentication. Note however, that this may change.
The trinity website can be visually divided into follwing parts,
- top logo image
- main nav menus
- side nav menus
- downloadable items
- notice
- events
- news
- footer
The api is designed to mimic this structure. Thus, you can access these parts with #+BEGIN_SRC js “/trinity/<topic>” #+END_SRC url suffix.
- To access top notice:
eg:
"https://site.com/trinity/notice"
This will give you json data of the top 3/4 notices visible on trinity homepage.
- For more flexibility, you can add arguments like
- ‘?type=top’
- ‘?type=all’
- ‘?type=link’
eg:
"https://site.com/trinity/notice?type=all"
This will give you a json data of all notices.
NOTE Not specifying any arguments is equivalent to specifying ‘?type=top’ argument.
In above examples, when top notices are requested, A LIST/ARRAY of json objects each with following attributes will be returned.
- title -> Title of notice
- link -> URL of page for this notice
eg:
[
{
"title": "First Term Examinations 2076",
"link": "http://trinitycollege.edu.np?page=notice&type=notice&id=457ps"
}
]
Similarly when all notices are requested. A LIST/ARRAY of json objects are returned. Each json object have following properies;
- title -> Title of notice
- link -> URL of page for this notice
- date -> Date when notice was issued
- content -> small description of notice
eg:
[
{
"title": "First Term Examinations 2076",
"link": "http://trinitycollege.edu.np?page=notice&type=notice&id=457ps",
"date": "Monday, 12 Aug 2019",
"content": "Notice"
}
]
NOTE Most of the time, the content field will have only ‘Notice’ or some short text.
Obiously when when link is requested a string of link is returned. In case of notice the url of all notices issued by trinity is returned.
eg:
The usage of all others are similar with the only diffrence being the url, arguments and the attributes of returned json obejects. The description and usage details of other endpoints are documented below.
ENDPOINT : ‘/notice’ ARGS :
- ‘?type=all, -> All notice
- ‘?type=top’ -> Top notice
- ‘?type=link’ -> Notice page link
Returns a list/array of json objects:
eg:
[
{
"title": "First Term Examinations 2076",
"link": "http://trinitycollege.edu.np?page=news&type=notice&id=457ps",
"date": "Monday, 12 Aug 2019",
"content": "Notice"
}
]
Returns a list/array of json objects:
eg:
[
{
"title": "First Term Examinations 2076",
"link": "http://trinitycollege.edu.np?page=news&type=notice&id=457ps",
}
]
Returns a json string of url of notice page
eg:
"http://trinitycollege.edu.np?page=news&type=notice",
ENDPOINT : ‘/news ARGS :
- ‘?type=all, -> All news
- ‘?type=top’ -> Top news
- ‘?type=link’ -> News page link
Returns a list/array of json objects:
eg:
[
{
"date": "Monday, 12 Aug 2019",
"title": "Congratulations! Trinitians",
"content": "Congratulations"
"link": "http://trinitycollege.edu.np?page=news&type=news&id=579",
}
]
Returns a list/array of json objects:
eg:
[
{
"title": "Congratulations! Trinitians",
"link": "http://trinitycollege.edu.np?page=news&type=news&id=579",
}
]
Returns a json string of url of news page
eg:
"http://trinitycollege.edu.np?page=news&type=news",
ENDPOINT : ‘/news ARGS :
- ‘?type=top’ -> Top events
- ‘?type=link’ -> Events page link
Returns a list/array of json objects:
eg:
[
{
"title": "Extra Tutorial Classes",
"subtitle": "+2 Students/A Level students",
"description": "Extra tutorial classes on particular sujects as",
"nepali_date": "27 Ashwin",
"english_date": "14 Oct",
"link": "http://trinitycollege.edu.np/eventdetails.php?i=653",
}
]
Returns a json string of url of events page
eg:
"http://trinitycollege.edu.np/trinity.php?cal=calen"
ENDPOINT : ‘/navigation ARGS :
- ‘?type=side’ -> Side navigation
- ‘?type=main’ -> Main navigation
Returns a list/array of json objects
eg:
[
{
"name": "Home",
"link": "http://trinitycollege.edu.np/index.php",
"image": "http://trinitycollege.edu.np/images/house_go.png",
}
]
Returns a list/array of json objects
eg:
[
{
"name": "Home",
"link": "http://trinitycollege.edu.np/index.php",
}
]
ENDPOINT : ‘/footer’
Returns a json object.
eg:
{
"privacy_policy": "http://trinitycollege.edu.np//index.php?page=content&id=59",
"disclaimer": "http://trinitycollege.edu.np//index.php?page=content&id=61",
"youtube" : "https://www.youtube.com/channel/UCI9QxocOF5Dy5_skkOYIGiA"
"twitter" : "https://twitter.com/TrinityHSSchool"
"facebook" : "https://www.facebook.com/Trinity-International-HSSCollege-123877371368846/?fref=ts"
}
ENDPOINT : ‘/downloadable’
Returns a json object.
eg:
{
"left": {
"caption" : "http://trinitycollege.edu.np//documents/timetable2019.pdf"
"link": "http://trinitycollege.edu.np//documents/timetable2019.pdf"
},
}