-
Notifications
You must be signed in to change notification settings - Fork 0
/
home.py
executable file
·58 lines (46 loc) · 1.37 KB
/
home.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
import requests
import pprint
from pathlib import Path
import toml
credentials = toml.load(Path("credentials.toml"))
id_= credentials['program_credentials']
def userIds():
cookies = {
}
headers = {
'User-Agent': 'SktchyForiPhone/3.0.0 (iPhone; iOS 14.0; Scale/3.00)',
'Content-Type': 'application/x-www-form-urlencoded',
'Accept-Language': 'en-US;q=1',
}
data = {
'_appv': '465',
'inEmail':id_['inEmail'],
'inPass': id_['inPass'],
'lang': 'en-US',
'pp': '50',
't': '2',
'zip': '1'
}
response = requests.post('https://api.sktchy.com/api/v1/graph/home', headers=headers, cookies=cookies, data=data)
posted_content = response.json()['graph/home']
# print(posted_content)
home_feed = []
for post in posted_content:
# pprint.pprint(post)
_id = post['_id']
_name = post['meta']['bya']
_by = post['meta']['by']
try:
_message = post['meta']['h']
except:
_message = 'No Message'
_userID = post['usrID']
json_ = {
'userID': _userID,
'_id': _id,
'_name': _name,
'_by': _by,
'_message': _message
}
home_feed.append(json_)
return home_feed