Ejemplo n.º 1
0
 def test_topics(self):
     #Valid Test 1 username
     api = Klout(self.KEY)
     data = api.identity('marcelcaraciolo', 'twitter')
     user_id = data['id']
     data = api.topics(user_id)
     for topic in data:
         for key in topic.keys():
             self.assert_(key in ['imageUrl','slug','displayName', 'id', 'name'])
Ejemplo n.º 2
0
 def test_topics(self):
     #Valid Test 1 username
     api = Klout(self.KEY)
     data = api.identity('marcelcaraciolo', 'twitter')
     user_id = data['id']
     data = api.topics(user_id)
     for topic in data:
         for key in topic.keys():
             self.assert_(
                 key in ['imageUrl', 'slug', 'displayName', 'id', 'name'])
Ejemplo n.º 3
0
#User score
try:
	score = api.score(user_id)
except Exception, e:
	print 'Can\'t get the score of %s:\n%s' % (username,e)
	exit()
print 'User score: %f' % (score['score'])

#User influences
try:
	data = api.influences(user_id)
except Exception, e:
	print 'Can\'t get influencers of %s:\n%s' % (username,e)
	exit()
print '\nInfluencers\n'
for x in data['myInfluencers']:
	nick = x['entity']['payload']['nick']
	score = x['entity']['payload']['score']['score']
	print '%s %f' % (nick, score)

#User topics
try:
	data = api.topics(user_id)
except Exception, e:
	print 'Can\'t get topics of %s:\n%s' % (username,e)
	exit()
print '\nTop topics\n'
for x in data:
	topic = x['displayName']
	print topic
Ejemplo n.º 4
0
#DESC: Transform Twitter entity into Klout topic URLs
import sys
import time
from MaltegoTransform import *
from pyklout import Klout

# throttle to 8 calls/sec, should permit Maltego to chew through
# long lists of Twitter accounts w/o overrunning API limit
time.sleep(.125)

# https://klout.com/s/developers/home
# register an app, get an API key
# wil look something like this
api = Klout("xfv9wju86xn4wqsqzexample")

name = str(sys.argv[1])

me = MaltegoTransform()

data = api.identity(name, 'twitter')
list = api.topics(data['id'])

for topic in list:
    name = topic['displayName']
    slug = topic['slug']
    NewEnt = me.addEntity("maltego.URL", name)
    NewEnt.addAdditionalFields("url", "URL", "",
                               "http://klout.com/topic/" + slug)

me.returnOutput()
Ejemplo n.º 5
0
#!/usr/bin/python
#DESC: Transform Twitter entity into Klout topic URLs
import sys
import time
from MaltegoTransform import *
from pyklout import Klout

# throttle to 8 calls/sec, should permit Maltego to chew through
# long lists of Twitter accounts w/o overrunning API limit
time.sleep(.125)

# https://klout.com/s/developers/home
# register an app, get an API key
# wil look something like this
api = Klout("xfv9wju86xn4wqsqzexample")

name = str(sys.argv[1])

me = MaltegoTransform();

data = api.identity(name,'twitter')
list = api.topics(data['id'])

for topic in list:
    name =topic['displayName']
    slug =topic['slug']
    NewEnt = me.addEntity("maltego.URL",name); 
    NewEnt.addAdditionalFields("url","URL","","http://klout.com/topic/" + slug);

me.returnOutput();
Ejemplo n.º 6
0
#User score
try:
    score = api.score(user_id)
except Exception, e:
    print 'Can\'t get the score of %s:\n%s' % (username, e)
    exit()
print 'User score: %f' % (score['score'])

#User influences
try:
    data = api.influences(user_id)
except Exception, e:
    print 'Can\'t get influencers of %s:\n%s' % (username, e)
    exit()
print '\nInfluencers\n'
for x in data['myInfluencers']:
    nick = x['entity']['payload']['nick']
    score = x['entity']['payload']['score']['score']
    print '%s %f' % (nick, score)

#User topics
try:
    data = api.topics(user_id)
except Exception, e:
    print 'Can\'t get topics of %s:\n%s' % (username, e)
    exit()
print '\nTop topics\n'
for x in data:
    topic = x['displayName']
    print topic