-
Notifications
You must be signed in to change notification settings - Fork 2
/
test.py
29 lines (24 loc) · 956 Bytes
/
test.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
from PrismAPI.Classes import PrismAPI
import os
import time
################################
## test.py file used for demonstration
## of jive in python
################################
# log on to prism.leidos.com and edit your profile to see your id...it's in the url (targetUser=12345)
#p_id = '<user_id>'
prism = PrismAPI.PrismAPI()
# set your Leidos username/password as environment variables
PRISM_USERNAME = os.environ.get('PRISM_USERNAME')
PRISM_PASSWORD = os.environ.get('PRISM_PASSWORD')
# Jive uses basic http auth
prism.set_basic_auth(PRISM_USERNAME,PRISM_PASSWORD)
# searching
query = ['President']
results = prism.search_people(query,100,0)
s_results = prism.simple_view(results) # simple view of jive information
for result in s_results:
print "%s, %s" % (result["Display Name"], result['Title'])
# update your status
new_status = 'The current date and time is ' + time.strftime("%Y-%m-%d %H:%M")
prism.status_update(new_status)