This the backend server running Fly Space-A. The backend downloads USAF AMC Space Available flight schedule photos from Facebook, processes flight schedule photos into text data, and provides the flight schedules to client applications over REST API. This code is fully functional. You will need to a free Facebook Graph API access token.
Please see the technical implementation slides also available in assets
directory for more detailed information on how photos are processed into text.
This backend used to provide the information needed for the free Fly Space-A service, but Facebook Graph API Page Public Content Access was revoked in mid-2018 during tightening of Graph API accesses due/related to the 2018 Cambridge Analytica news. Page Public Content Access became only available to approved to only verified "businesses" for reasons that make no sense as the name suggests: access to page content that is already public. "Individual" entities are only allowed the most limited accesses as of early-2019 and have no Page Public Content Access. When contacted, Facebook support equivalented sole propriertor entity to an "individual" entity. Subsequently, the new mid-2018 "App Review" process was never completed and Graph API access was blocked.
I am releasing the code in hope that this helps you with your projects. Also because Fly Space-A is not running due to the above issue.
All code produced by Anson Liu is released under MIT License. Linked libraries retain the licenses of their respective authors.
-
Install Go
-
go get https://github.com/ansonl/flyspacea-backend
-
Paste your Facebook Graph API Access Token into
constants.go
. -
Set $DATABASE_URL to your PostgreSQL database URL.
-
go install spacea
-
spacea -procMode=all
All the constants mentioned below are located in constants.go
.
-
To generate updated timezones for a set of terminals with latitude and longitude inputed into the terminal JSON file (set at
TERMINAL_FILE
, setDEBUG_EXPORT_TERMINAL_TZ
to true. -
To run photo processing on a single terminal's photos, set
DEBUG_TERMINAL_SINGLE_FILE
to true and place the individual terminal JSON data into the filename set atTERMINAL_SINGLE_FILE
. This will download the terminal's photo from the associated Facebook page specified by Facebook ID and process the photos into flight data. -
To run photo processing on local images, set
DEBUG_MANUAL_IMAGE_FILE_TARGET
to true. This will make Fly Space-A process images in the directory set asDEBUG_MANUAL_IMAGE_FILE_TARGET_TRAINING_DIRECTORY
with the extension set asDEBUG_MANUAL_FILENAME
.
*Recommend first skimming technical implementation slides also available in assets
folder for an overview of the photo processing steps. More information on debug modes can be obtained by searching for occurences of the debug constants in the entire project directory to find instances of debug constant usage. *
latlng by bradfitz
pq - Golang PostgreSQL driver
Fuzzy by Sajari
Tesseract OCR by Google
goprocinfo by c9s