Skip to content

Instantly share code, notes, and snippets.

View nickpersico's full-sized avatar

Nick Persico nickpersico

View GitHub Profile

Keybase proof

I hereby claim:

  • I am nickpersico on github.
  • I am nickpersico (https://keybase.io/nickpersico) on keybase.
  • I have a public key ASBNFkal7p4cikaG8Eh2yg2IhpjGP8lxCsZvy9EZdioaCQo

To claim this, I am signing this object:

@nickpersico
nickpersico / calculate_user_time_to_reach_lead.py
Last active April 19, 2018 17:24
A method for calculating how much time it takes a User to reach out to new Lead in Close.io
from closeio import Client
from datetime import datetime
API_KEY = 'CLOSE.IO API KEY'
list_of_times_between_date_created_and_call_made = []
# Get a list of leads using a search query
def get_list_of_leads_via_search_query(api_key, search_query):
@nickpersico
nickpersico / assign_leads_in_closeio.py
Last active April 19, 2018 15:28
An example for assigning a Lead to a "User" Custom Field in Close.io
# Install Close.io's python API wrapper with "pip install closeio" - https://github.com/closeio/closeio-api
from closeio_api import Client
API_KEY = 'CLOSE.IO API KEY'
LEAD_ID = 'CLOSE.IO LEAD ID'
CLOSEIO_USER_FULL_NAME = 'FULL NAME'
# Get the Close.io user ID from a name
def get_user_id_from_name(api_key, name):
@nickpersico
nickpersico / Smart Host JSON Pricing Calendar Feed.py
Last active June 3, 2016 19:43
Documentation for the Smart Host JSON pricing calendar feed.
{
"total_results": 1, # The total number of listings in the feed.
"date_created": "2015-12-15 09:56:36", # The timestamp for when the feed was last updated/created.
"listings": [
{
"listing_url": "https://www.homeaway.com/vacation-rental/p651701vb", # The listing URL in the Smart Host account
"listing_id": 869768, # The Smart Host ID for the listing
"skyrun_property_id": 1234, # The unique SkyRun property ID
"pricing_calendar": [
{
curl -i http://www.smarthost.me/api/price\?q\=Lower%20East%20Side
{
"price_min": 60,
"price_quartile1": 75,
"price_mean": 107.85,
"price_median": 98,
"price_quartile3": 178,
"price_max": 500,
"total": 3051,
"beds": 2,
"zipcode": "19103",
"link": "http://airbnb.com/rooms/2115785",
"addrees": "Market Street, Philadelphia, Pennsylvania 19103",
"latitude": -75.16531582686208,
"country": "United States of America",
"price": 500,
"bedrooms": 2,
@nickpersico
nickpersico / jsbin.UYuMANOh.html
Created January 20, 2014 12:22 — forked from anonymous/jsbin.UYuMANOh.html
Parse Angular Sign Up Example
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.7/angular.min.js"></script>
<script src="http://www.parsecdn.com/js/parse-1.2.12.min.js"></script>
<meta charset=utf-8 />
<title>Example</title>
</head>
<body ng-app="AuthApp">
<div ng-hide="currentUser">
____ ____ ___ ____ _ _ ____ _____ ____
| _ \ | _ \ / _ \ | _ \ | | | | / ___||_ _|/ ___|
| |_) || |_) || | | || | | || | | || | | | \___ \
| __/ | _ < | |_| || |_| || |_| || |___ | | ___) |
|_| |_| \_\ \___/ |____/ \___/ \____| |_| |____/
___ _ _
|_ _|| \ | |
| | | \| |
| | | |\ |
|___||_| \_|
@nickpersico
nickpersico / gist:6887427
Created October 8, 2013 16:30
This code calculates the amount of invoiced opportunities are created and changed to "invoice" status in Close.io.
##### TIME DATA ######
upcomingsunday = today + relativedelta.relativedelta(weeks=0, weekday=6)
ifmonday = today + relativedelta.relativedelta(weeks=-1, weekday=0)
monday = today.isoweekday() in range (1, 6)
day = datetime.datetime.today().weekday()
if today == current_monday:
###### Invoices Out This Week
week_inv_url = 'https://app.close.io/api/v1/activity/status_change/opportunity/?date_created__gt=%s&date_created__lt=%s' % (rightmonday, upcomingsunday)
week_inv_created_url = 'https://app.close.io/api/v1/opportunity/?status_id=%s&date_created__gt=%s&date_created__lt=%s' % (invoice_status, rightmonday, upcomingsunday)
week_inv = 0
week_inv_created = 0
week_inv_value = 0
week_inv_value_c = 0
has_more = True