diff --git a/README.md b/README.md index 069fe35..437581e 100644 --- a/README.md +++ b/README.md @@ -3,15 +3,16 @@ ![screenshot](https://raw.githubusercontent.com/TekniskSupport/ST-zigbee-network-map/master/screenshot.png "screenshot") -Made primarily for my own use. Uses *European IDE*, so you might need to change the [URI](https://github.com/TekniskSupport/ST-zigbee-network-map/blob/master/_scrape.py#L8) - First run: `python -m pip install matplotlib bs4 networkx requests` Then run from terminal: `python scrape-st.py` -### Extract cookie from session: +### Optionally pass sessionID as commandline argument +`python scrape-st.py YOUR-JSESSION-ID` + +### Extract JSESSIONID value from cookie: Chrome: - login to [IDE](https://account.smartthings.com) diff --git a/_scrape.py b/_scrape.py index 5aa73ef..2bd543e 100644 --- a/_scrape.py +++ b/_scrape.py @@ -1,10 +1,14 @@ +import sys import networkx as nx import re import requests from bs4 import BeautifulSoup G = nx.Graph() -cookies = {'JSESSIONID': input("JSESSIONID:")} +if (len(sys.argv) > 1): + cookies = {'JSESSIONID': sys.argv[1]} +else: + cookies = {'JSESSIONID': input("JSESSIONID:")} hostList = { 'https://graph.api.smartthings.com', 'https://graph-na02-useast1.api.smartthings.com',