Giter Site home page Giter Site logo

tcc_webapi's Introduction

TCC-webapi

This is API for web resources that are scraped and distributed from following sites;

Requirements to use

Following knowledge in your favorable language is expected:

  1. Sending http requests and receiving data.
  2. Working with json data.

Getting Started

The hosted api can currently be accessed without any authentication. Note however, that this may change.

API endpoints

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.

  1. 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.

  1. 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.

Json Data

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.

Documentation

Notice

ENDPOINT : ‘/notice’ ARGS :

  • ‘?type=all, -> All notice
  • ‘?type=top’ -> Top notice
  • ‘?type=link’ -> Notice page link

All 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",
  "date": "Monday, 12 Aug 2019",
  "content": "Notice"
  }
]

Top 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",
  }
]

Notice page link

Returns a json string of url of notice page

eg:

"http://trinitycollege.edu.np?page=news&type=notice",

News

ENDPOINT : ‘/news ARGS :

  • ‘?type=all, -> All news
  • ‘?type=top’ -> Top news
  • ‘?type=link’ -> News page link

All news

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",
  }
]

Top news

Returns a list/array of json objects:

eg:

 [  
  {
  "title": "Congratulations! Trinitians",
  "link": "http://trinitycollege.edu.np?page=news&type=news&id=579",
  }
]

News page link

Returns a json string of url of news page

eg:

"http://trinitycollege.edu.np?page=news&type=news",

Events

ENDPOINT : ‘/news ARGS :

  • ‘?type=top’ -> Top events
  • ‘?type=link’ -> Events page link

Top events

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",
  }
]

Events page link

Returns a json string of url of events page

eg:

"http://trinitycollege.edu.np/trinity.php?cal=calen"

Navigation

ENDPOINT : ‘/navigation ARGS :

  • ‘?type=side’ -> Side navigation
  • ‘?type=main’ -> Main navigation

Side 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",
  }
]

Main navigation

Returns a list/array of json objects

eg:

 [  
  {
  "name": "Home",
  "link": "http://trinitycollege.edu.np/index.php",
  }
]

Footer

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"
}

Downloadable

ENDPOINT : ‘/downloadable’

Returns a json object.

eg:

{
  "left": {
      "caption" : "http://trinitycollege.edu.np//documents/timetable2019.pdf"
      "link": "http://trinitycollege.edu.np//documents/timetable2019.pdf"
  },
}

tcc_webapi's People

Contributors

hemanta212 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.