GithubHelp home page GithubHelp logo

rapportive's Introduction

Travis-CI Build Status

Note: It looks like Rapportive recently changed their API, breaking the functionality of this library. If I have time to look into this further, I'll see if I can get it back up and running. Until then - I'm accepting PR's ๐Ÿ˜„

rapportive.py

Python library to automate Rapportive queries.

You can refer to my blog post here for more information.

##Installation To install rapportive, just run python setup.py install.

##Usage

from rapportive import rapportive
profile = rapportive.request('[email protected]')

Results are received as a Profile object, which contains the following attributes:

  • profile.name - Name of contact
  • profile.memberships - List of tuples of memberships (Linkedin, Facebook, Blogger, etc.)
  • profile.jobinfo - Tuple of (position, company)

rapportive's People

Contributors

jordan-wright avatar moshekaplan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rapportive's Issues

AttributeError: 'dict' object has no attribute 'name'

Hey,
After the first 6 requests, it starts to give the error above. It does not let me time out or anything.
AttributeError: 'dict' object has no attribute 'name'
I have written this small program.

from rapportive import rapportive
def mail():

open email address

f = open('mentor_emails.txt','r')
emails = [line.split(',') for line in f.readlines()]
for i in range(len(emails)):
    profile = rapportive.request(emails[i][0])
    print profile.name
    print profile.jobinfo 
    print profile.memberships

profile.success raises AttributeError

Traceback (most recent call last):
File "/usr/local/bin/rapportive_cmd", line 5, in
pkg_resources.run_script('rapportive==0.1.0', 'rapportive_cmd')
File "/usr/lib/python2.6/dist-packages/pkg_resources.py", line 467, in run_script
self.require(requires)[0].run_script(script_name, ns)
File "/usr/lib/python2.6/dist-packages/pkg_resources.py", line 1200, in run_script
execfile(script_filename, namespace, namespace)
File "/usr/local/lib/python2.6/dist-packages/rapportive-0.1.0-py2.6.egg/EGG-INFO/scripts/rapportive_cmd", line 8, in
exit(main())
File "/usr/local/lib/python2.6/dist-packages/rapportive-0.1.0-py2.6.egg/rapportive/rapportive.py", line 132, in main
___process_email(arg, output)
File "/usr/local/lib/python2.6/dist-packages/rapportive-0.1.0-py2.6.egg/rapportive/rapportive.py", line 104, in ___process_email
if profile and profile.success != 'nothing_useful':
AttributeError: 'unicode' object has no attribute 'success'

class Profile line 41, should be initialized with all those fields set to empty strings in case person is not given and then, after line 103, you could use smth like: if profile and isinstance(profile, Profile) and profile.success:

Error Handling

For a request if the response is 'nothing useful' the program stops running and throws error as below:


Traceback (most recent call last): File "./rapportive.py", line 136, in <module> main() File "./rapportive.py", line 132, in main ___process_email(arg, output) File "./rapportive.py", line 104, in ___process_email if profile and profile.success != 'nothing_useful': AttributeError: 'unicode' object has no attribute 'success


SSL issue; getting it to work

I'm trying to work with this script, but running the following lines gives an error.

To get it working i should run;
from rapportive import rapportive
profile = rapportive.request('[email protected]')

from rapportive import rapportive

gives;
error: from: can't read /var/mail/rapportive

and

profile = rapportive.request('[email protected]')
gives;
-bash: syntax error near unexpected token `('

Is their an email system required to get this all working??
As now ./rapportive.py -e [email protected] gives an error

I run the scrips on a Debian machine

Script not working

I had some troubles in implementing the rapportive script and I believe that I might have missed some or the other thing. Here is the snap of my terminal, please check on it and revert back.

image

AttributeError: 'Profile' object has no attribute 'get'

Hey, I'm new to Python so this might be an error on my part, but after installing your python scripts and running the test command:

rapportive_cmd -e [email protected]

I get:

Traceback (most recent call last):
  File "/usr/local/bin/rapportive_cmd", line 5, in <module>
    pkg_resources.run_script('rapportive==0.1.0', 'rapportive_cmd')
  File "build/bdist.macosx-10.9-x86_64/egg/pkg_resources.py", line 492, in run_script
  File "build/bdist.macosx-10.9-x86_64/egg/pkg_resources.py", line 1350, in run_script
  File "/usr/local/lib/python2.7/site-packages/rapportive-0.1.0-py2.7.egg/EGG-INFO/scripts/rapportive_cmd", line 8, in <module>
    exit(main())
  File "/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/rapportive-0.1.0-py2.7.egg/rapportive/rapportive.py", line 135, in main
    ___process_email(arg, output)
  File "/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/rapportive-0.1.0-py2.7.egg/rapportive/rapportive.py", line 105, in ___process_email
    success = profile.get('success')
AttributeError: 'Profile' object has no attribute 'get'

Status 403

How are people dealing with status 403 and the throttle limits?

I did a loop to create random email, fetch a session and then do a call... still getting a 403.

Any work arounds?

Not able to get the same results as when using the Chrome extension

Hi there,

I'm playing with the script and it works perfectly on my own email address and on your email address. However, when trying some co-workers and friends, the results are empty.

When I use the Google Chrome extension it shows their details, but the script results are empty.

Any idea how there can be a difference between the Chrome extension vs using this script? It's hitting the same API right?

Jelmer.

Can we get this on pypi?

pip + setuptools tooling for depending on git repositories is absolutely 100% abysmal and I'm going to throw myself off my balcony if I can't get an actual package soon.

plz

for me

Fix for hitting request limit?

Hey Jordan,

I've been using this rapportive "API" (I love it by the way) and when I do it too often I get an error about making too many requests. I made a small change to your rapportive.py code to return this instead of breaking the function, it's on line 85 and looks like this:

' ' '
if 'error' in response: #checking if we're calling too often
return 'error'
elif response['status'] == 200 and session_token:
' ' '

Logging configuration call should move to the __name__ == '__main__' clause

I would recommend that the line

logging.basicConfig(format='%(asctime)s %(name)-12s %(levelname)-8s %(message)s',
                    datefmt='%m-%d %H:%M')

be moved either into the main method or the __name__ == '__main__' clause. I realise that rapportive is meant to be run as a script - nevertheless, just importing it should not cause side effects such as configuring logging.

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.