firehopper
firehopper copied to clipboard
Rhino Grasshopper's RESTful interface for Google Firebase
firehopper
Rhino Grasshopper's RESTful interface for Google Firebase
Firehopper is a Grasshopper add-in that interacts with Google Firebase in RESTful ways. User can simply request a PUT to store JSON style data in Google Firebase, PATCH to modify, POST to incrementally save data, DELETE to delete, and reqeust GET to fetch the data. This component will be updated further to support different functionality supported by Google Firebase.
How to use
Setup
Create Google Firebase account for free
Visit http://firebase.google.com to create an account and to create new project.
Retrieve DB URL and API Key
After creating the account and the project, you can get the following information from 'Project Overview' section in the Firebase console. We need 'apiKey' and 'databaseURL' values.
Download Firehopper
Download firehopper.gha in the 'Release' tab in this github repo or at food4rhino(http://www.food4rhino.com/app/firehopper) and save under the Grasshopper library folder.
Data
firehopper Key-Value Pair Generator
The key-value pair generator combines two sets of strings into JSON style string format. The component will throw an error when two lists contain different amount of string elements inside.
HTTP
firehopper PUT
The PUT component triggers PUT request to Firebase to store the JSON string. This component requires 'apiKey' and 'databaseURL' information retrieved from the 'Setup' section in this page. Basic usage of the PUT component is illustrated on below images:
After triggering the PUT component, the component will send the JSON string to corresponding Firebase database using the API key and Database URL. The result of above example is shown below:
firehopper PUT with Key-Value Generator
The PUT component can be used with the firehopper Key-Value Generator as well.
The result of above example is shown below:
firehopper GET
The GET component triggers GET request to Firebase to fetch the JSON string. This component requires 'apiKey' and 'databaseURL' information retrieved from the 'Setup' section in this page. Basic usage of the GET component is illustrated on below images:
Query using ghJSON
JSON string retrieved from firehopper GET component can be further queried with ghJSON(https://mathrioshka.ru/ghjson/) as below example:
firehopper POST
Will be updated soon.
firehopper PATCH
Will be updated soon.
firehopper DELETE
Will be updated soon.
Usage Example with Geometry Parameter
Development Environment:
- Microsoft Visual Studio Community 2017 Version 15.5.0
- Rhino Version 5 SR14 64-bit
- Grasshopper Build 0.9.0076
Dependancies (run-time version):
- Grasshopper.dll (v4.0.30319)
- System.Net.Http.dll (v4.0.30319)
Author
Hojoong Chung https://github.com/hodgoong http://hojoongchung.blogspot.com hojoong.chung(at)gmail.com
firehopper © 2018 Hojoong Chung