From 47a40729844c7841de67914720637291c652b19b Mon Sep 17 00:00:00 2001 From: Rafay Ghafoor Date: Mon, 26 Mar 2018 18:23:33 +0500 Subject: [PATCH] Update README.md --- README.md | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index c4754d9..7d42a94 100755 --- a/README.md +++ b/README.md @@ -10,29 +10,35 @@ The API is currently under heavy development. ```python -from router import Router -papi = Router(gateway='192.168.10.1', password='ptcl') +>>> from router import Router +>>> papi = Router(gateway='192.168.10.1', password='ptcl') # Output the list of active devices -papi.stationinfo() # ['c8:94:bb:75:f6:23', '04:8d:38:f5:44:ef'] +>>> papi.stationinfo() +>>> ['c8:94:bb:75:f6:23', '04:8d:38:f5:44:ef'] # Number of active devices -len(papi.stationinfo() # 2 +>>> len(papi.stationinfo() +>>> 2 # Output DHCP info (dictionary with key-> hostname and values-> mac address, local IP, expire time) -papi.dhcpinfo() # {'android-950c5330c76d8678': ['00:08:22:ca:e6:21', '192.168.1.9', '23 hours, 25 minutes, 39 seconds'] } +>>> papi.dhcpinfo() +>>> {'android-950c5330c76d8678': ['00:08:22:ca:e6:21', '192.168.1.9', '23 hours, 25 minutes, 39 seconds'] } # Block a device -papi.block('00:08:22:ca:e6:21') +>>> papi.block('00:08:22:ca:e6:21') +>>> 'Succesful' # Set time limit for a device -papi.time_limit(username='Fred', mac='00:08:22:ca:e6:21', days='Mon-Thu', start='12', end='14:26') +>>> papi.time_limit(username='Fred', mac='00:08:22:ca:e6:21', days='Mon-Thu', start='12', end='14:26') +>>> 'Successful' # will create a profile named 'Fred' and set a time limit from 12:00-14:26, Monday to Thursday. # Block a website -papi.web_filter(url='facebook.com') +>>> papi.web_filter(url='facebook.com') +>>> 'Successful' ```