Giter Site home page Giter Site logo

hackney_libraries_autologin's Introduction

hackney_libraries_autologin

Introduction

CLR James library offers free Wi-Fi. However, every hour my Mac gets booted off; I suspect they either require explicit re-login to demonstrate client liveliness or just don't support Macs.

This tool logs into their web portal when needed; your connection will die for on average 5 seconds before the tool kicks in.

Requirements

Quickstart

  • Clone the repo.
  • (if you installed virtualenv and virtualenvwrapper):
    • mkvirtualenv hackney_libraries_autologin
    • workon hackney_libraries_autologin
  • pip install -r requirements.txt
  • Launch the Keychain Access application.
  • Add a new account called Hackney Libraries.
    • Set the username field to your library card's number.
    • Set the password to your PIN.
  • Quit the Keychain Access application.
  • Execute ./src/auto_login.py.
  • If you want to immediately attempt to login rather than wait for the script, press ENTER.

How it works

  • Use the airport command-line utility to confirm that we are both connected to a Wi-Fi network and that the Wi-Fi network's SSID is LBH-Libraries.
  • If the above is true, determine if we need to re-login by attempting to HTTP GET https://securelogin.arubanetworks.com/; it times out if we don't need to log in, and redirects to a login page if we do need to log in.
  • If we need to log in, HTTP POST to https://securelogin.arubanetworks.com/cgi-bin/login with appropriate x-url-form-encoded content, cookies, and referrer.
  • We get the credentials directly from Keychain Access by executing security.

That should be enough instructions to modify the script if need be; consult the top-most section titled Constants for stuff to change if need be.

hackney_libraries_autologin's People

Contributors

asimihsan avatar

Watchers

 avatar  avatar

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.