Giter Site home page Giter Site logo

pyklout's Introduction

PyKlout

PyKlout is an Python interface to Klout (http://klout.com) API.

Use of PyKlout requires a Klout API key. You can register and get a key at http://developer.klout.com/member/register

Now Supporting the API Release V2.

How to Install it

After download the source code by:

easy_install pyklout

or

https://github.com/marcelcaraciolo/PyKlout/tarball/master

Just execute the command at the terminal:

$ python setup.py install

How to Use it

>>> from pyklout import Klout
>>> api = Klout('YOUR API KEY GOES HERE')
>>>
>>> # Get the Klout Score 
>>> data = api.identity('marcelcaraciolo', 'twitter')
>>> #First you must fetch the klout user id.
>>> user_id = data['id']
>>> api.score(user_id)
{u'score': 51.613044738769531, u'scoreDelta': {u'dayChange': -0.25563812255859375, \
 u'monthChange': -0.54084014892578125, u'weekChange': -0.67768478393554688}}
>>>
>>> #Get the User influences
>>> data = api.influences(user_id)
>>> print data
{u'myInfluencersCount': 12, u'myInfluenceesCount': 688, u'myInfluencers': [{u'entity': {u'id': u'32088152110374909', \
 u'payload': {u'kloutId': u'32088152110374909', u'score': {u'score': 68.181953430175781}}}}, {u'entity': \
 {u'id': u'35747326807441155', u'payload': {u'kloutId': u'35747326807441155', u'scoreDeltas': \
 {u'dayChange': -0.2061004638671875, u'monthChange': 0.52481460571289062, u'weekChange': -0.73615646362304688}, \
u'score': {u'score': 61.678096771240234}}}}, {u'entity': {u'id': u'528598', u'payload': {u'kloutId': u'528598', \
 u'scoreDeltas': {u'dayChange': -0.30794143676757812, u'monthChange': -1.3581733703613281, \
u'weekChange': -0.95804977416992188}, u'score': {u'score': 57.507125854492188}}}}, \
{u'entity': {u'id': u'57420900014600367', u'payload': {u'kloutId': u'57420900014600367', u'scoreDeltas': \
 {u'dayChange': -0.10103988647460938, u'monthChange': -0.78160476684570312, u'weekChange': 0.048831939697265625}, \
 u'score': {u'score': 55.013530731201172}}}}, {u'entity': {u'id': u'84723972974129636', u'payload': \
{u'kloutId': u'84723972974129636', u'scoreDeltas': {u'dayChange': 0.34136962890625, u'monthChange': 14.804290771484375, \
 u'weekChange': -0.1102142333984375}, u'score': {u'score': 50.926513671875}}}}], u'myInfluencees': \
[{u'entity': {u'id': u'970250', u'payload': {u'kloutId': u'970250', u'scoreDeltas': {u'dayChange': -0.20825576782226562, \
u'monthChange': 0.56769561767578125, u'weekChange': -0.17999267578125}, u'score': {u'score': 46.707504272460938}}}}, \
 {u'entity': {u'id': u'27866027459763237', u'payload': {u'kloutId': u'27866027459763237', u'scoreDeltas': \
 {u'dayChange': -0.20732498168945312, u'monthChange': 1.8845806121826172, u'weekChange': -1.0561943054199219}, \
u'score': {u'score': 29.672574996948242}}}}, {u'entity': {u'id': u'291630', u'payload': {u'kloutId': u'291630', \
u'scoreDeltas': {u'dayChange': 3.017303466796875, u'monthChange': 2.9252605438232422, u'weekChange': 3.0163726806640625}, \
u'score': {u'score': 13.129240036010742}}}}]}

>>> # Get the Top topics for the username
>>> data = api.topics(user_id) 
>>> print data
[{u'imageUrl': u'http://kcdn3.klout.com/static/images/icons/generic-topic.png', u'slug': u'artificial-intelligence', \
 u'displayName': u'Artificial Intelligence', u'id': u'6715916572741025395', u'name': u'artificial intelligence'}, \
 {u'imageUrl': u'http://kcdn3.klout.com/static/images/books-1333558978086.png', u'slug': u'books', u'displayName': \
u'Books', u'id': u'5807244297982144638', u'name': u'books'}, {u'imageUrl': u'http://kcdn3.klout.com/static/images/topics/social-media.png', \
 u'slug': u'blogging', u'displayName': u'Blogging', u'id': u'7331299376965973530', u'name': u'blogging'}, {u'imageUrl': \ u'http://kcdn3.klout.com/static/images/icons/generic-topic.png', u'slug': u'python', u'displayName': u'Python', u'id': \
u'8389956153950126978', u'name': u'python'}, {u'imageUrl': u'http://kcdn3.klout.com/static/images/icons/generic-topic.png', \
 u'slug': u'idf', u'displayName': u'Idf', u'id': u'1242', u'name': u'idf'}]

pyklout's People

Contributors

marcelcaraciolo avatar

Stargazers

Micah Stubbs avatar James Chang avatar Vishal Vikram Singh avatar Jan Zikes avatar Henry Nevue avatar Alberto Labarga avatar JT5D avatar Stuart Powers avatar Onur Varol avatar  avatar Alja Isakovic avatar Eric Gallager avatar Adam Buran avatar Mek avatar Hussein Ahmed avatar Kristof Leroux avatar Vlad Berteanu avatar Tyler Singletary avatar Gustavo Gawryszewski avatar Shobhit avatar  avatar Jeremy Sandell avatar Tarek Amr avatar Bruno Melo avatar

Watchers

 avatar Rodrigo Fortes avatar James Cloos avatar James Chang avatar

pyklout's Issues

Fetch the klout user id shows invalid API Key error

PyKlout was working fine when i last used it around 2 weeks back. Now, in the demo sample:
` data = api.identity('marcelcaraciolo', 'twitter')``

data when printed on the terminal shows:
{'description': invalid or unprovided API key. All calls must have a key.', 'error': 403}

Any assistance would be highly appreciated.
Thanks a lot

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.