As a freelancer, I build a lot of web sites. That's a lot of code changes to track. Thankfully, a Git-enabled workflow with proper branching makes short work of project tracking. I can easily see development features in branches as well as a snapshot of the sites' production code. A nice addition to that workflow is that ability to use Git to push updates to any of the various sites I work on while committing changes.
This file contains hidden or 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
| #! /bin/bash | |
| #I wrote this because I had a list of ~500 publisher IDs, and needed their corresponding titles and contact emails. | |
| #This script loops through lines in a plaintext file (this file should consist of GUIDs on their own lines, and nothing else) | |
| #It grabs the GUID from the file and feeds it into the curl command | |
| #The curl command queries the GBIF Registry API for the plugged in GUID ($line) | |
| #It then pipes the output to jq, which grabs the key (GUID - redundant, but I wanted to easily check that it was working) title, and email values | |
| #It does some custom text formatting magic so that the values are comma separated for easy (lazy) import into a csv, especially since the @csv option for jq kept saying the data type for the .email values weren't appropriate for CSV or some such | |
| #and then you get nice normalized output on the screen, like: 533ae0fc-1f4d-4a43-a578-be7a9c874857,University of North Carolina Wilmington,["email@fakeemail.nospam"] |
This file contains hidden or 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
| #In this example I used a single-column CSV file, rsets.csv with a header - "rsets" - containing a list of 473 iDigBio recordsetIDs. | |
| #load the ridigbio library | |
| library(ridigbio) | |
| #read and load the CSV into R, as "symbsets" | |
| symbsets <- read.csv("/Users/caitlin.chapman/Code stuff/json/rsets.csv") | |
| #idig_count_records() returns the number of records for a given query - in this case, we are querying the number of records | |
| #in an entire recordset, querying for recordset ID (e.g. recordset="9c963109-9898-4953-a351-d5ee36d6115b") |