💥 rename everything to match django_code instead
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
from django.apps import AppConfig
|
||||
from django.http import HttpResponse
|
||||
from django.shortcuts import render
|
||||
from django.shortcuts import redirect
|
||||
import time
|
||||
import random
|
||||
|
||||
def hello(request):
|
||||
return HttpResponse('<h1>Hello Simpsons!</h1>')
|
||||
|
||||
def simpsons(request):
|
||||
simpsons_url = "https://www1.kisscartoon.online/episode/the-simpsons-season-";
|
||||
number_of_seasons = 35
|
||||
seasons_maximum_number = [13,22,24,22,22,25,25,25,25,23,22,21,22,22,22,21,22,22,20,21,23,22,22,22,22,22,22,22,21,23,22,22,22,22,18]
|
||||
|
||||
#print(simpsons_url)
|
||||
|
||||
random_seasons = random.randint(1, number_of_seasons)
|
||||
print("random seasons: "+ str(random_seasons))
|
||||
|
||||
#random_seasons-1 because list start at index 0
|
||||
print("maximum of episode for this season: "+str(seasons_maximum_number[random_seasons-1]))
|
||||
|
||||
random_episode = random.randint(1, seasons_maximum_number[random_seasons-1])
|
||||
|
||||
print("random episode: "+ str(random_episode))
|
||||
|
||||
|
||||
final_url = simpsons_url+str(random_seasons)+ "-episode-"+str(random_episode)#
|
||||
print(final_url)
|
||||
|
||||
# return HttpResponse(str(final_url))
|
||||
time.sleep(10)
|
||||
return redirect(str(final_url))
|
||||
Reference in New Issue
Block a user