Skip to main content

Makes creating a server to be pinged easier

Project description

                     GitHub issues GitHub forks GitHub stars GitHub license Python Python Hits

                                               If you like the package please can you star the github.

Development of the package is currently temporarally paused i will continue if issues or suggestions are posted.

██████╗ ██╗███╗   ██╗ ██████╗     ███████╗███████╗██████╗ ██╗   ██╗███████╗██████╗ 
██╔══██╗██║████╗  ██║██╔════╝     ██╔════╝██╔════╝██╔══██╗██║   ██║██╔════╝██╔══██╗
██████╔╝██║██╔██╗ ██║██║  ███╗    ███████╗█████╗  ██████╔╝██║   ██║█████╗  ██████╔╝
██╔═══╝ ██║██║╚██╗██║██║   ██║    ╚════██║██╔══╝  ██╔══██╗╚██╗ ██╔╝██╔══╝  ██╔══██╗
██║     ██║██║ ╚████║╚██████╔╝    ███████║███████╗██║  ██║ ╚████╔╝ ███████╗██║  ██║
╚═╝     ╚═╝╚═╝  ╚═══╝ ╚═════╝     ╚══════╝╚══════╝╚═╝  ╚═╝  ╚═══╝  ╚══════╝╚═╝  ╚═╝
                                 built by @Necrownyx

PingServer

PingServer is a python package that makes things more convenient to set up a server to be pinged by uptimerobot.com this package is most useful on sites like replit.com where your program might shut down after being idle for too long

Usage

First import the package with:

            pip install PingServer

Then import it with:

            import PingServer

Then add this one line to start the server:

            PingServer.start()

The start() command has an optional parameter for a message on the web page to be pinged.

How to run on a thread.

If you want to run the server on its own thread you can put this in your code:

            PingServer.thread().start()

This module of the package can also take a custom message for example:

            PingServer.thread("hello, world!").start()

Will output "hello, world!" on the webpage.

How to serve multiple pages.

If you want to serve multiple different pages first create the page use either:

            PingServer.create_page(route, message)

with route being the route of the site for example: '/' and message being the message to be served to users or a html file name for example index.html this file must be in the templates directory of your project.

You can loop through this as many times as you want.

Then when you have defined all of the pages for your site run:

            PingServer.launch_pages().start()

To run all the sites on a thread or:

            PingServer.launch_pages_nothread()

To run the sites on the main thread.

Background.

This is the first python package I have ever made and is somewhat of a tutorial for myself with something I will be able to use for things like discord bots on replit.com and more.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

PingServer-1.0.1.tar.gz (7.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

PingServer-1.0.1-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

Details for the file PingServer-1.0.1.tar.gz.

File metadata

  • Download URL: PingServer-1.0.1.tar.gz
  • Upload date:
  • Size: 7.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.9.12

File hashes

Hashes for PingServer-1.0.1.tar.gz
Algorithm Hash digest
SHA256 31129c822067d1feb114993e59a10333532a18dbc8d5576e1af2a6847b84161b
MD5 438ecb89a7b576e512e41e2febcb381f
BLAKE2b-256 6e26344f673a507b4ec922363d0fbfaad70d93dc3359f4bb533ddf02aab8e947

See more details on using hashes here.

File details

Details for the file PingServer-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: PingServer-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 6.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.9.12

File hashes

Hashes for PingServer-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 83b8137d097e2660e1b85c1f74268ab004740e3be2e7916b82ebb3e5ebed6140
MD5 f0dabd849747d00cf30af4b9e5ab4b91
BLAKE2b-256 aa4a7d9af9ff1580db59c655958cebf6e005304d64a8d3315660690d9e065029

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page