This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'json' | |
require 'openssl' | |
require 'sinatra' | |
SIFT_WEBHOOK_SECRET_KEY = "#####" | |
post '/webhook' do | |
# Let's check whether this webhook actually came from Sift Science! | |
# First let's grab the signature from the postback's headers | |
postback_signature = request.env['X-Sift-Science-Signature'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cv2 | |
import io | |
import json | |
import numpy as np | |
import os | |
from google.cloud import vision | |
from PIL import Image, ImageDraw | |
from StringIO import StringIO |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ast | |
import os | |
import matplotlib | |
matplotlib.use('Agg') | |
import matplotlib.pyplot as plt | |
from collections import defaultdict | |
def walk_dir(dirname, ext): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
city | state | state_code | county_code | place_code | |
---|---|---|---|---|---|
New York | NY | 36 | 000 | 51000 | |
Los Angeles | CA | 06 | 000 | 44000 | |
Chicago | IL | 17 | 000 | 14000 | |
Houston | TX | 48 | 000 | 35000 | |
Philadelphia | PA | 42 | 000 | 60000 | |
Phoenix | AZ | 04 | 000 | 55000 | |
San Antonio | TX | 48 | 000 | 65000 | |
San Diego | CA | 06 | 000 | 66000 | |
Dallas | TX | 48 | 000 | 19000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I want to congratulate Senator Clinton on a hard-fought victory here in | |
New Hampshire. | |
A few weeks ago, no one imagined that we'd have accomplished what we did | |
here tonight. For most of this campaign, we were far behind, and we | |
always knew our climb would be steep. But in record numbers, you came | |
out and spoke up for change. And with your voices and your votes, you | |
made it clear that at this moment - in this election - there is | |
something happening in America. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import csv | |
import tweepy | |
# get credentials at developer.twitter.com | |
auth = tweepy.OAuthHandler('API Key', 'API Secret') | |
auth.set_access_token('Access Token', 'Access Token Secret') | |
api = tweepy.API(auth) | |
# update these for whatever tweet you want to process replies to |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.