Skip to content

Commit

Permalink
Adding Deliverable 2
Browse files Browse the repository at this point in the history
  • Loading branch information
ejaysing committed Nov 24, 2020
1 parent 9604fb8 commit 56bea66
Show file tree
Hide file tree
Showing 8 changed files with 2,107 additions and 0 deletions.
Binary file added nebip/.DS_Store
Binary file not shown.
Binary file added nebip/Deliverable_2/.DS_Store
Binary file not shown.
Binary file not shown.
1,999 changes: 1,999 additions & 0 deletions nebip/Deliverable_2/Boston_Community_Data.csv

Large diffs are not rendered by default.

Binary file added nebip/Deliverable_2/Deliverable 2.pdf
Binary file not shown.
69 changes: 69 additions & 0 deletions nebip/Deliverable_2/guidestarAPI.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
import requests
import csv
import time
import json
import pandas as pd
import sys


"""
This script will allow you to enter the EIN's as strings into the list called
charities so it is added to a file called go.txt found in the same folder
as this file.
Things to look out for:
- the EIN's must be strings
- the Subscription key is a trial key and there are rougly 130 calls left
- there must already be a file called go.txt (or whatever you choose in
the same folder as this file)
- The API will only allow for about 5 calls for every 30 seconds
E - Name
F - EIN
CT-CU - Total revenue:
CV - Contributions:
CW - Gov't grants:
CX - Program services:
CY - Investments:
CZ - Special events:
DA - Sales:
DB - Other:
DY - Total expenses:
DE - Program services:
DD - Administration:
DF - Fundraising:
"""

charities = ["enter charity EIN's here or read from CSV"]

def charToJson():

counter = 1

for x in charities:
organization_id = x

response = requests.get(f"https://apidata.guidestar.org/premier/v3/{organization_id}",
headers={
"Subscription-Key": "secret"
}
)

with open("go2.txt", "a") as myfile:
myfile.write(response.text)

counter += 1

if (counter%5 == 0):
time.sleep(30)


"""
Inputting a JSON file to https://json-csv.com/ will manually parse through the CSV
- Currently testing ways to complete this step with pandas
"""





39 changes: 39 additions & 0 deletions nebip/Deliverable_2/rocket_linkedin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import rocketreach
from linkedin_scraper import Person, actions
from selenium import webdriver

# Teri Williams - OneUnited Bank (No Teri Williams, but Teri Cohee) - id=3609442
# Farrah Belizaire - LiteWork Events (Doesn't show up when company included) - id=1259121
# Terryl Calloway - Calloway Graphix (2 Results with name and current employer, who?)
# Herby Duverne - Windwalker Group (Wrong Corp name - Windwalker Corporation, also accent on e)

# Finds the person through search
# Search and Lookup result documentation:
# https://github.com/rocketreach/rocketreach_python/blob/master/rocketreach/person.py
rr = rocketreach.Gateway(rocketreach.GatewayConfig('apikey'))

# # Code for Searches (does not return linkedin link)
s = rr.person.search().filter(name="")
result = s.execute()
for person in result.people:
print(person)

# Code for lookups
f = open("info.txt","w")
result = rr.person.lookup(person_id=id)
if result.is_success:
person = result.person
f.write("ID: "+ person.id)
f.write("Name: "+ person.name)
f.write("Employer: "+ person.current_employer)
f.write("LinkedIn: "+ person.linkedin_url)
# linkedin_urls.append(person.linkedin_url)


# LinkedIn Scraper
driver = webdriver.Chrome()
linkedin_urls = ["https://www.linkedin.com/in/teri-williams-cohee-99811029"]
actions.login(driver, "username", "password")
linkedin_person = Person(linkedin_urls[0], driver=driver,scrape=False)
linkedin_person.scrape(close_on_complete=False)
print(linkedin_person)
Binary file added nebip/Deliverable_2/sampleGuidestarData.xlsx
Binary file not shown.

0 comments on commit 56bea66

Please sign in to comment.