GoodGameRuler / GoodGameRuler/unitrack_v3

Request Endpoint/Response Body for Search Bar Functionality

Open
#70 10 comments 1 reaction 1 assignee Claimed by @GoodGameRuler View on GitHub
enhancement help wanted not noob friendly work-in-progress
Dominant language
JavaScript
Stars
3
Forks
7
PR merge metrics
No merged PRs in 30d

Description

- [x] Show the units as user is typing accordingly (as shown in the prototype below)
- [ ] For MVP: Go to the unit of study page when unit is clicked (e.g: clicking COMP2017 will go to https://www.sydney.edu.au/units/COMP2017)

Screenshot 2024-05-29 at 11 43 12 AM

On the route /units, I am unable to utilise the search bar functionality feature. Would love to see this implemented!

I did some analysis (Via Dev Tools -> Network) on [https://www.sydney.edu.au/units](https://www.sydney.edu.au/units/) page to see if I could obtain the REST API endpoint and response body for querying information about a unit.

When I query "COMP" into the search bar, I notice a request is made to the following resource: `https://www.sydney.edu.au/s/search.html?query=COMP&collection=Sydney-Curriculum_UOS&profile=_default_preview&form=custom-json&start_rank=1`.

The corresponding response body is of the form:

```
{
"resultsSummary" : {
"fullyMatching" : 108,
"totalMatching" : 108,
"numRanks" : 10,
"currStart" : 1,
"currEnd" : 10
},
"results":[
{
"rank" : 1,
"uosCode" : "COMP3608",
"description" : "An advanced alternative to COMP3308; covers material at an advanced and challenging level.",
"title" : "Introduction to Artificial Intelligence (Adv)",
"uosApprovalFlag" : "YES",
"UoSURL" : "https://sydney.edu.au/students/units/unit.COMP3608.html"
}
,
{
"rank" : 2,
"uosCode" : "COMP2022",
"description" : "This unit provides an introduction to the foundations of computing. The main aims are to introduce and compare different models of computation based on state-machines, grammars and algebra, and logic.",
"title" : "Models of Computation",
"uosApprovalFlag" : "YES",
"UoSURL" : "https://sydney.edu.au/students/units/unit.COMP2022.html"
}
,
{
"rank" : 3,
"uosCode" : "COMP3109",
"description" : "This unit provides an introduction to the foundations of programming languages and their implementation. The main aims are to teach what are: semantics, programming paradigms and implementation of programming languages.",
"title" : "Programming Languages and Paradigms",
"uosApprovalFlag" : "YES",
"UoSURL" : "https://sydney.edu.au/students/units/unit.COMP3109.html"
}
,
{
"rank" : 4,
"uosCode" : "COMP2922",
"description" : "This unit provides an introduction to the foundations of computing. The main aims are to introduce and compare different models of computation based on state-machines, grammars and algebra, and logic.",
"title" : "Models of Computation (Adv)",
"uosApprovalFlag" : "YES",
"UoSURL" : "https://sydney.edu.au/students/units/unit.COMP2922.html"
}
,
{
"rank" : 5,
"uosCode" : "COMP4103",
"description" : "Students enrolled in the Honours programs study various advanced aspects of Computer Science. The program may include lectures, tutorials, seminars and practicals. They will undertake a research project. Assessment will include the project and may include examinations and classwork.",
"title" : "Computer Science Honours Project A",
"uosApprovalFlag" : "YES",
"UoSURL" : "https://sydney.edu.au/students/units/unit.COMP4103.html"
}
,
{
"rank" : 6,
"uosCode" : "COMP4104",
"description" : "Students enrolled in the Honours programs study various advanced aspects of Computer Science. The program may include lectures, tutorials, seminars and practicals. They will undertake a research project. Assessment will include the project and may include examinations and classwork.",
"title" : "Computer Science Honours Project B",
"uosApprovalFlag" : "YES",
"UoSURL" : "https://sydney.edu.au/students/units/unit.COMP4104.html"
}
,
{
"rank" : 7,
"description" : "Students enrolled in the Honours programs study various advanced aspects of Computer Science. The program may include lectures, tutorials, seminars and practicals. They will undertake a research project. Assessment will include the project and may include examinations and classwork.",
"uosCode" : "COMP4105",
"title" : "Computer Science Honours Project C",
"uosApprovalFlag" : "YES",
"UoSURL" : "https://sydney.edu.au/students/units/unit.COMP4105.html"
}
,
{
"rank" : 8,
"uosCode" : "COMP4106",
"description" : "Students enrolled in the Honours programs study various advanced aspects of Computer Science. The program may include lectures, tutorials, seminars and practicals. They will undertake a research project. Assessment will include the project and may include examinations and classwork.",
"title" : "Computer Science Honours Project D",
"uosApprovalFlag" : "YES",
"UoSURL" : "https://sydney.edu.au/students/units/unit.COMP4106.html"
}
,
{
"rank" : 9,
"uosCode" : "COMP4447",
"description" : "This is an advanced course on Pervasive Computing, with a focus on the Internet of Things (IoT). It introduces the key aspects of the IoT and explores these in terms of the new research towards creating user interfaces that disappear into the environment and are available pervasively, for example in homes, workplaces, cars and carried.",
"title" : "Pervasive Computing",
"uosApprovalFlag" : "YES",
"UoSURL" : "https://sydney.edu.au/students/units/unit.COMP4447.html"
}
,
{
"rank" : 10,
"uosCode" : "COMP5047",
"description" : "This is an advanced course on Pervasive Computing, with a focus on the Internet of Things (IoT). It introduces the key aspects of the IoT and explores these in terms of the new research towards creating user interfaces that disappear into the environment and are available pervasively, for example in homes, workplaces, cars and carried.",
"title" : "Pervasive Computing",
"uosApprovalFlag" : "YES",
"UoSURL" : "https://sydney.edu.au/students/units/unit.COMP5047.html"
}
]
}
```

I've omitted the request/response headers from this post as they are quite lengthy but happy to include them in comments if necessary.

This endpoint seems fairly simple to call and it is publicly accessible. A client-side fetch request should suffice for completing the unit search feature but there may be other approaches as well.

Hopefully this information gives enough of a jump start for working on the feature!

Screenshot 2024-06-02 at 2 58 36 pm

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.