forked from degiere/linkedin-visualizations
-
Notifications
You must be signed in to change notification settings - Fork 0
/
example.py
45 lines (32 loc) · 1.01 KB
/
example.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
from linkedin import LinkedInApi, parser, nlp
import nltk
from tokens import user_token, user_secret
api = LinkedInApi.LinkedInApi(user_token, user_secret)
def doIt():
json_prof = api.profile()
print json_prof
profile = parser.parse(json_prof)
#print "Name: " + profile['firstName'] + ' ' + profile['lastName']
raw = parser.raw(profile)
raw = nlp.ascii(raw)
tokens = nlp.tokenize(raw)
tokens = nlp.normalize(tokens)
print "Tokens:"
print ' '.join(tokens)
freq = nlp.freq_dist(tokens, 3)
print "Frequent:"
print ' '.join(freq)
vocab = nlp.vocabulary(tokens)
print "Vocabulary: "
print vocab
text = nltk.Text(tokens)
print "Text: " + str(type(text))
#json_conn = api.connections()
#connections = parser.parse(json_conn)['values']
#print parser.connections_str(connections)
def peopleSearch():
results = api.peopleSearch("java%20spring%20cassandra")
print parser.parse(results)
if __name__ == "__main__":
peopleSearch()
#doIt()