diff --git a/infoscreen/views.py b/infoscreen/views.py index 28a9399..831168a 100644 --- a/infoscreen/views.py +++ b/infoscreen/views.py @@ -16,6 +16,7 @@ import sikweb.settings as settings import json import logging import threading +import requests def index(request, idx, *args, **kwargs): @@ -35,6 +36,9 @@ def default(request,*args,**kwargs): return index(request,first ,*args, **kwargs) +def get_apy_json(request): + return HttpResponse(requests.get("https://api-diilikone.apy.fi/deals/top-groups").text) + @require_http_methods(["GET"]) def rotation(request, idx, *args, **kwargs): try: diff --git a/sikweb/urls.py b/sikweb/urls.py index fd559a7..968f344 100644 --- a/sikweb/urls.py +++ b/sikweb/urls.py @@ -69,6 +69,7 @@ from infoscreen.views import delete_rotation from infoscreen.views import CurrentHSLView from infoscreen.views import admin as infoscreen_admin from infoscreen.views import hsl_timetable_settings +from infoscreen.views import get_apy_json #application from members.views import application_index from members.views import list_applications @@ -130,6 +131,7 @@ urlpatterns = [ url(r'^infoscreen/delete_rotation/(?P\d+)$', delete_rotation), url(r'^infoscreen/hsl_data$', CurrentHSLView), url(r'^infoscreen/hsl_data/settings$', hsl_timetable_settings), + url(r'^infoscreen/apyjson', get_apy_json), #application url(r'^application/$', application_index), url(r'^application/success$', application_success_index),