Skip to content

Commit

Permalink
Merge pull request #370 from DigvijayBhosale1729/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
adeyosemanputra authored Aug 25, 2022
2 parents b08e2ca + af4041f commit b03896d
Show file tree
Hide file tree
Showing 2,299 changed files with 360,181 additions and 1,957 deletions.
33 changes: 30 additions & 3 deletions SecureTea_Server/securetea_api/views.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from urllib.parse import uses_fragment
from django.http import Http404, HttpRequest, HttpResponse
from django.http import Http404, HttpRequest, HttpResponse, JsonResponse
from django.shortcuts import render
from numpy import empty
from rest_framework.response import Response
Expand All @@ -21,6 +21,7 @@
import signal
import subprocess
import re
import json


# Create your views here.
Expand Down Expand Up @@ -104,7 +105,31 @@ def register(request):
@api_view(["GET"])
def test_api(request):
"""Endpoint to check if the endpoint works or not"""
return Response('ep_working')
data ={
"id": 1,
"name": "Leanne Graham",
"username": "Bret",
"email": "Sincere@april.biz",
"address": {
"street": "Kulas Light",
"suite": "Apt. 556",
"city": "Gwenborough",
"zipcode": "92998-3874",
"geo": {
"lat": "-37.3159",
"lng": "81.1496"
}
},
"phone": "1-770-736-8031 x56442",
"website": "hildegard.org",
"company": {
"name": "Romaguera-Crona",
"catchPhrase": "Multi-layered client-server neural-net",
"bs": "harness real-time e-markets"
}
}
output = json.dumps(data, indent=2)
return HttpResponse(output, content_type="application/json")

@api_view(["POST"])
def get_uptime(request):
Expand Down Expand Up @@ -501,7 +526,8 @@ def sleep(request):

if "hist_logger" in creds and creds["hist_logger"]:
args_str+="--hist "


"""
# Twitter parsing
if ("twitter_api_key" in creds and
"twitter_access_token" in creds and
Expand All @@ -515,6 +541,7 @@ def sleep(request):
args_str += ' --twitter_api_secret_key="' + creds['twitter_api_secret_key'] + '"'
args_str += ' --twitter_access_token="' + creds['twitter_access_token'] + '"'
args_str += ' --twitter_access_token_secret="' + creds['twitter_access_token_secret'] + '"'
"""

# Telegram parsing
if ("telegram_token" in creds and
Expand Down
Loading

0 comments on commit b03896d

Please sign in to comment.