Giter Club home page Giter Club logo

Teapot-Tools

Teapot-Tools is a very simple python 3 module that lets you play with Google's 418 teapot, by rotating it or making it pour tea whenever you want. It currently only works with Firefox, but adapting it to Chrome would be pretty easy. Universal version coming soon:tm: Universal version is out! See Parameters below. Untested on other browsers than Firefox, but it should work on them as well.

WARNING: The pypi package is out of date. Will hopefully update it soon. Please manually install from this repo until then.

This module assumes you have the selenium package installed, and the path to its driver (depends on the browser you're using).

Usage

An example of how it works:

from teapottools import TeapotTools as teapot
import time

tt = teapot('C:/geckodriver.exe') #this will fire up a new browser session.

tt.rotate(150) #rotate the teapot to 150 degrees
tt.pour() #make the teapot pour tea (beware, it's never heard of gravity before)
time.sleep(5)
tt.unpour() #stop the teapot from spilling tea on the floor
tt.reset() #reset the teapot to its original state
tt.close() #close the browser session

Parameters

You can pass 3 parameters into TeapotTools:

  • browser - The browser you're using. Valid options are 'Firefox', 'Chrome', 'Ie' and 'Opera'.
  • driver_exec - The path to your browser's selenium driver
  • delay - The time in s to wait before trying to fetch the data from the website. This is especially useful for people with slow internet connections, as it allows them to wait longer until the page has fully finshed loading. Defaults to 2.

Teapot Tools's Projects

teapot-tools icon teapot-tools

A simple python module to have fun with Google's 418 error.

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.