Skip to content

Instantly share code, notes, and snippets.

@Libisch
Libisch / get_related_by_field.json
Created July 25, 2017 07:40
API get related photos of 202567
@Libisch
Libisch / get_202567.json
Created July 25, 2017 07:30
clearmash_api_get_202567
{
"Entities": [{
"Acl": null,
"Changeset": 7220208,
"Document": {
"Fields_Boolean": [{
"Id": "entity_has_pending_changes",
"Value": false
}, {
"Id": "is_archived",
@Libisch
Libisch / py
Last active July 5, 2017 11:29
response_get_docs_by_related_field
{'Entities': [{'Acl': None,
'Changeset': 4793755,
'Document': {'Fields_Boolean': [{'Id': 'entity_has_pending_changes',
'Value': False},
{'Id': 'is_archived', 'Value': False},
{'Id': 'is_deleted', 'Value': False},
{'Id': '_c6_beit_hatfutsot_bh_base_template_ugc', 'Value': False}],
'Fields_ChildDocuments': [{'ChildDocuments': [{'AllowedGroups': [],
'Value': {'Fields_Boolean': [],
'Fields_ChildDocuments': [],
@Libisch
Libisch / bagnowka_dump_to_mongo.py
Created May 21, 2017 09:01
Latest update (currently on server)
#!/usr/bin/env python
from pymongo import MongoClient
import os
import requests
client = MongoClient(os.environ.get("MONGO_HOST", "localhost"), int(os.environ.get("MONGO_PORT", "27017")))
db = client[os.environ["MONGO_DB"]]
photoUnits = db['photoUnits']
data = requests.get("https://raw.githubusercontent.com/Beit-Hatfutsot/dbs-bagnowka-scrape/master/bagnowka_all.json").json()
{
"title": "Jewish Displaced Persons and Refugee Cards, 1943-1959",
"scanned_doc_url": "http://search.archives.jdc.org/multimedia%2FDocuments%2FVMB_cardindex%2F31157_176215%2F31157_176215-00455.jpg",
"description": "This is a collection of registration cards of Jewish survivors who registered with the Emigration Department of JDC in Munich and Vienna after World War II for help in emigrating to countries other than Israel. The database includes individual cards from 1945-mid 1950s for 51,554 Displaced Persons in Munich and 25,374 Displaced Persons in Vienna.",
"name": "Lipa Goldmann",
"migration_location": "Wasserburg",
"birthdate": "6/17/1907",
"location_of_birth": "Zenta",
"accompanied_by": [
"Helene Goldmann",
@Libisch
Libisch / new_api_response
Last active December 18, 2016 15:36
New API response for Places ("Paris", including 1 example of 15 results)
{
"items": "1-15 of 44", // If possible - show items count out of total
"total": "44", // Current: ["hits"]["total"]
"results": [ // Current: Second ["hits"]["hits"]
{
"collection_type": "places", // Current: ["hits"]["hits"][x]["_type"]
"id": "72312", // ? Ask Benny if needed
"title_en": "Paris", // Current: ["hits"]["hits"][x]["_source"]["Header"]["En"]
"title_he": "פריס", // Current: ["hits"]["hits"][x]["_source"]["Header"]["He"]
"text_en": "In 582, the date of the first documentary evidence of the presence of Jews in Paris, there was already a community with a synagogue. In 614 or 615, the sixth council of Paris decided that Jews who held public office, and their families, must convert to Christianity. From the 12th century on there was a Jewish quarter. According to one of the sources of Joseph ha- Kohen's Emek ha-Bakha, Paris Jews owned about half the land in Paris and the vicinity. They employed many Christian servants and the objects they took in pledge included even church vessel