Coder Social home page Coder Social logo

isitup's People

Contributors

lord63 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

isitup's Issues

Feature request: Script should return an error code when the page is down

I stumbled upon this coming from https://github.com/sindresorhus/is-up-cli which inspired this project.

The nice thing about is-up-cli is that it returns a specific error code when the site is down and can therefore be used in automated scripts.

My use case is the following:
I want to check if my self-hosted website is reachable from the internet and otherwise restart the Raspberry Pi where it's hosted. I'm struggling with a few network issues -- which I don't quite understand right now -- that go away when I reboot the Pi.

A simple way to test this is to run the following code in a Shell:

# Do something in case the page is up.
isitup nope.it.isnt && echo "Hell yeah! Everything's fine"

# Do something in case the page is down.
isitup nope.it.isnt || echo "Site is down"

I'd rather like to use this tool as it is written in Python which I understand and have the environment for on every machine. For is-up-cli I would need to install node.js and npm.

InsecurePlatformWarning

Upon running isitup initially, I received this warning.

InsecurePlatformWarning: A true [135/661]
A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#insecureplatformwarning.

Now I did fix this, but I am writing up this issue to help others who may come across this.
I received this error when installing using pip install isitup as is stated to do in the instructions. However, I have Python 2.7 and Python 3.4 installed on my machine, the default pip for me installed isitup for Python 2.7.

The problem was fixed when I ran these lines:

pip uninstall isitup  
pip3 install isitup

I would also recommend the reader first making sure pip is updated and installed for Python 3 by following these instructions first.

Add user agent

Sorry for that, will add the user agent and release a new version tomorrow.

Any client (browser or bot) must provide an accurate and appropriate user agent description when using isitup and it's api.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.