Skip to content

Commit

Permalink
added sessionid commandline argument
Browse files Browse the repository at this point in the history
  • Loading branch information
iesus committed Jun 21, 2020
1 parent 19de490 commit 5b35b66
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 5 additions & 1 deletion _scrape.py
Original file line number Diff line number Diff line change
@@ -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',
Expand Down

0 comments on commit 5b35b66

Please sign in to comment.