Skip to content

Instantly share code, notes, and snippets.

View thisismattmiller's full-sized avatar
😑
...

Matt Miller thisismattmiller

😑
...
View GitHub Profile
@thisismattmiller
thisismattmiller / places.py
Created November 20, 2020 23:05
Code for Google Place API Demo: https://youtu.be/kgWaSZU0Um8
import requests
import json
import time
key = 'YOURKEYHERE'
url = 'https://maps.googleapis.com/maps/api/place/nearbysearch/json'
all_data = {}
import csv
artsts = ["Salvador Dalí", "May Ray", "Giorgio de Chirico", "Pablo Picasso", "Marcel Duchamp", "Francis Picabia", "André Masson", "Joan Miró", "Joan Miró", "René Magritte", "Paul Delvaux", "Yves Tanguy", "Matta", "Frida Kahlo", "Diego Rivera", "Diego Rivera", "Dorothea Tanning", "Leonora Carrington", "Hans Bellmer", "Roland Penrose", "Stella Snead", "Jean Arp", "Luis Buñuel", "Bridget Bate Tichenor", "Toyen", "Leonor Fini", "Dora Maar", "Kay Sage"]
with open("data/MetObjects.csv", "r") as artwork_csv:
processed_csv = csv.reader(artwork_csv)
import requests
import json
url = "https://www.wikidata.org/wiki/Special:EntityData/"
qnumbers = ['Q43260736', 'Q51827254', 'Q56471556']
all_properties = {}
for qnum in qnumbers:
@thisismattmiller
thisismattmiller / niles_and_frasier_generate.py
Created November 15, 2020 15:54
The source code from this building twitter bot video: https://youtu.be/fA2SVTIYKes
from bs4 import BeautifulSoup
import json
# with open('all_eps.json','r') as out:
# all_eps = json.load(out)
all_eps = json.load(open('all_eps.json'))
all_tweets = []
@thisismattmiller
thisismattmiller / met_test.py
Last active November 13, 2020 18:41
Use the met API to get object information
import requests
import json
# the search end point
search_end_point = 'https://collectionapi.metmuseum.org/public/collection/v1/search'
# the object endpoint
object_end_point = 'https://collectionapi.metmuseum.org/public/collection/v1/objects/'
# let's make a place for all of our object data to live
object_data = []
import requests
import json
btoken = 'YOUR_TOKEN_HERERERRERER'
url = 'https://api.twitter.com/2/tweets/search/recent'
headers = {"Authorization": f"Bearer {btoken}"}
NAF All --- https://id.loc.gov/authorities/names/suggest/?q=<QUERY>&count=25
NAF Personal Names --- https://id.loc.gov/authorities/names/suggest/?q=<QUERY>&rdftype=PersonalName&count=25
NAF Corporate Name --- https://id.loc.gov/authorities/names/suggest/?q=<QUERY>&rdftype=CorporateName&count=25
NAF Name/Title --- https://id.loc.gov/authorities/names/suggest/?q=<QUERY>&rdftype=NameTitle&count=25
NAF Title --- https://id.loc.gov/authorities/names/suggest/?q=<QUERY>&rdftype=Title&count=25
NAF Geographic --- https://id.loc.gov/authorities/names/suggest/?q=<QUERY>&rdftype=Geographic&count=25
NAF Conference Name --- https://id.loc.gov/authorities/names/suggest/?q=<QUERY>&rdftype=ConferenceName&count=25
LCSH All --- https://id.loc.gov/authorities/subjects/suggest/?q=<QUERY>&count=25
LCSH Topics --- https://id.loc.gov/authorities/subjects/suggest/?q=<QUERY>&rdftype=Topic&count=25
We can make this file beautiful and searchable if this error is corrected: It looks like row 8 should actually have 10 columns, instead of 5. in line 7.
Real estate forms and arithmetic. DAILEY, VERA IRENE. A463363 Vera Irene Dailey Not renewed.
Lumber and building products. DAIN SUPPLY CO., INC., Hans G. Faltin A457860 National Consumer Publications Not renewed.
Civil code of Louisiana; amendments, additions and repeals, 1947-1960. 1960 pocket part. DAINOW, JOSEPH A471983 West Pub. Co. Not renewed.
Dairy credit book, 1960-61. DAIRY CREDIT BUREAU. A452752 Dairy Credit Bureau Not renewed.
Master milker's manual. DAIRY EQUIPMENT TESTING CO., INC., Francis F. Smith A461804 Dairy Equipment-Testing Co., Inc. Not renewed.
Easy find bowling averages for men and women. DAJOPAT. A456884 Morris Flaxman d.b.a. Dajopat Not renewed.
Chancellor, Davis, Flyger, South Dakota and others telephone directory, Including Viborg and Marlon exchanges of Northwestern Bell Telephone Company. DAKOTA CO-OPERATIVE TELEPHONE CO., INC. A453086 Dakota Co-operative Telephone Co., Inc. Not renewed.
DAKOTA DIGEST, 1960 cumulative annual pocket part. A4557
import requests
import time
import json
headers = {'X-GraphDB-Password': 'XXXXXXXXXX'}
r = requests.post('http://IPADDRESS:7200/rest/login/USERNAME',headers=headers)
token = r.headers['Authorization']
files = ["entities","genres","geonames","instruments","roles","venues","works","events"]
@thisismattmiller
thisismattmiller / docker-compose.yml
Last active May 18, 2020 20:03
Wikibase Install May 2020
# Wikibase with Query Service
#
# This docker-compose example can be used to pull the images from docker hub.
#
# Examples:
#
# Access Wikibase via "http://localhost:8181"
# (or "http://$(docker-machine ip):8181" if using docker-machine)
#
# Access Query Service via "http://localhost:8282"