Question: I have a Python Scipt running over on repl.it, but I assume it stops when I close the tab, since I don't own a Premium ("Hacker") account. When hosting my Discord Bot, I tried to add a piece of python that SHOULD make it run forever. Why SHOULD? I checked on it a few days ago, it was offline :-/ But confusingly, this setup worked a whole bunch of time (about half a year), except since a few days ago.

piece of extra Python (webapp.py):

```
from flask import Flask
from threading import Thread
import datetime

app = Flask(__name__)

@app.route('/')
def main_func():

    content = "<p>" + "Online @ " + str(datetime.datetime.now()) + "</p>"
    return content

def run():
    app.run(host="0.0.0.0", port=8080)

def keep_alive():
    server = Thread(target=run)
    server.start()

```

actual discord bot (main.py)

```
from webapp import keep_alive
import discord

# discord bot stuff
client = discord.Client()

keep_alive()

client.run() # run discord bot

```

Then I pinged the now running server (webbap.py) using [Uptimerobot](https://uptimerobot.com) which, as said, worked fine a long time.
(Whats happening here is, that the uptimerobot pings the site every 5 mins, which should cause it to not go to sleep, since there is a limit (30 mins after last HTTP traffic) when exceeding, the server goes to sleep)
My question now is, was that just an accident? I have a new project now, which involves web-scraping data for a longer period of time (around 4 months) automatically. That project script needs to be running 24/7 without any exception.

Answer: 
Well, replit doesn't offer complete 24/7 uptime on any repls, even the hacker repls. The UptimeRobot trick may have been an accident but it works well for slightly less important projects. If you have a school email account, GitHub offers a plan which lets you get free Hacker for 6 months [here](https://education.github.com/pack) and others services. What I would personally do if you do not have a school account, is to make a couple of UptimeRobot pingers for your repl, or use a different host. A way more reliable host is [Googles service](https://www.youtube.com/watch?time_continue=4&v=T_4cGEtHqUs&feature=emb_title), which may require some sort of billing but they probably have a sort of free trial for that.
You could use a Oracle Cloud Free Tier virtual instance, which is always on and easy to setup.