status client service mlapi_GetLinks idsite ok_stat OK sleep_stat Slee

 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
status = client.service.mlapi_GetLinks(idsite)
ok_stat = u"OK"
sleep_stat = u"Sleep"
error_stat = u"NA"
unmoderated_stat = u"Unmoderated"
archived_stat = u"Archived"
wait_stat = u"Wait"
try:
site_stat_ok = client.service.mlapi_GetLinks_byStatus(idsite, ok_stat)
site_stat_ok = len(site_stat_ok[0])
ok = site_stat_ok
except Exception as e:
print str(e)
ok = 0
try:
site_stat_sleep = client.service.mlapi_GetLinks_byStatus(idsite, sleep_stat)
site_stat_sleep = len(site_stat_sleep[0])
sleep = site_stat_sleep
except Exception as e:
print str(e)
sleep = 0
try:
site_stat_error = client.service.mlapi_GetLinks_byStatus(idsite, error_stat)
site_stat_error = len(site_stat_error[0])
error = site_stat_error
except Exception as e:
print str(e)
error = 0
try:
site_stat_unmoderated = client.service.mlapi_GetLinks_byStatus(idsite, unmoderated_stat)
site_stat_unmoderated = len(site_stat_unmoderated[0])
unmoderated = site_stat_unmoderated
except Exception as e:
print str(e)
unmoderated = 0
try:
site_stat_archived = client.service.mlapi_GetLinks_byStatus(idsite, archived_stat)
site_stat_archived = len(site_stat_archived[0])
archived = site_stat_archived
except Exception as e:
print str(e)
archived = 0
try:
site_stat_wait = client.service.mlapi_GetLinks_byStatus(idsite, wait_stat)
site_stat_wait = len(site_stat_wait[0])
wait = site_stat_wait
except Exception as e:
print str(e)
wait = 0