Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Link to lecture room/location not always created? #47

Closed
kolkinn opened this issue Aug 18, 2014 · 4 comments
Closed

Link to lecture room/location not always created? #47

kolkinn opened this issue Aug 18, 2014 · 4 comments

Comments

@kolkinn
Copy link

kolkinn commented Aug 18, 2014

It seems that some locations don't get hyperlinked, in this case Vembi:
screen shot 2014-08-18 at 21 51 00 Without hyperlink
screen shot 2014-08-18 at 22 09 20 With hyperlink

Not quite sure how the links are made, but

"rooms":[{"location":"H3 Datasal 424 Vembi","lydiaCode":"358424","locationAnnotation":" "}]

gives lydiaCode 358424 which in turn I would think is used in the following query:
http://www.ntnu.no/studieinformasjon/rom/?romnr=358424

The result from this query among other things gives this url which should be appropriate as a hyperlink for Vembi:
http://www.ntnu.no/kart/358/424

Unsure as to why the hyperlink is not created. Haven't studied the Plan code enough, but a very wild guess would be that it has something to do with "location" and "name" not being equal?

"location":"H3 Datasal 424 Vembi"

From https://www.ime.ntnu.no/api/schedule/it3105

"name":"Vembi"

From https://www.ime.ntnu.no/api/fdv/rooms/lydiacode:358424

Any thoughts?

@adamcik
Copy link
Owner

adamcik commented Aug 18, 2014

https://github.com/adamcik/plan/blob/master/plan/scrape/ntnu/web.py#L106 sorts based on the exact match, and then tries the first result and gives up. So yes the heuristics for matching could without doubt be improved. I think I even left a TODO in the code for this type of cases.

@adamcik
Copy link
Owner

adamcik commented Aug 18, 2014

Ok, thanks for reminding me to look at this again. So I think I can use https://www.ime.ntnu.no/api/fdv/buildings + https://www.ime.ntnu.no/api/fdv/rooms to create a mapping from lydiaCode --> http://www.ntnu.no/kart/358/424 type links.

@adamcik
Copy link
Owner

adamcik commented Aug 19, 2014

Right, so didn't end up going the API route, had forgotten about how many funny cases there are in handling that data correctly. But instead added handling for when we get the room directly from http://www.ntnu.no/studieinformasjon/rom/?romnr=358424 so that Vembi and a few other missing rooms should now be in place.

@adamcik adamcik closed this as completed Aug 19, 2014
@kolkinn
Copy link
Author

kolkinn commented Aug 19, 2014

Great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants