API problem with curl

When I go to the countryside for my field technician job I often make visual observations with photos with my Olympus TG-3 with GPS: excellent photos.
When I get home I download them with GThumb, I select them, I make them smaller.
Often on the field I don’t have time to write many notes, also I don’t have a smartphone, the tablet is old and uncomfortable to carry around.
Here I was born the idea of creating observations on FarmOS from the photos.
This is my solution:
I create a little script to create a .json file from a photo with command

exiftool -p json.fmt -d %s file.jpeg > out.json

The json.fmt:

{
“name”: “$description#”,
“notes”:{“value”:“\u003Cp\u003E$filename#\u003C/p\u003E\n”,“format”:“farm_format”},
“type”: “farm_observation”,
“timestamp”: “$datetimeoriginal”,
“geofield”:[{“geom”:“POINT($gpslongitude# $gpslatitude#)”}]
}

For the file image it’s difficult to realise base64 I believe.
But I can upload the photo later manually. The important thing is to upload an observation that has the exact point of the photo and the exact date and time of the shot, and the description I gave to the photo.

when it comes to photos of insects I load the photos into the INATURALIST: in this way I have help in identifying.
The next step could be to use the INaturalist API to create an observation in FarmOS with the position, description and in the notes the link to the observation on INaturalist.

I’m so happy!

2 Likes