HorizonBrief is a personal assistant to brief you on your day, including weather updates at locations you care about and your calendar events. Powered by Google Gemini.
English Demo
DemoEN.mp4
Turkish Demo
DemoTR.mp4
- Copy one of the example config files into
config.jsonand fill in according to your preferences. - Copy
.env.examplefile into.envand fill in your API keys. Info on how to get API keys is written below. You can also set thePORTvariable to change the port the server listens on (default is 3000). - Build application using
go build -o horizonBrief main.go. An example systemd service file is provided inhorizonBrief.service.
Sending a GET request to the /day endpoint will start the briefing process. Sound generation takes about 30 seconds. After that sound will be played using ebitengine/oto.
You can send the request in any way you like, some examples are:
- Raspberry Pi with a button connected to GPIO pins, and a script that sends the request when the button is pressed
- A cron job with
curl - From a mobile device using a widget app like HTTP Request Shortcuts
- Go to the Google Cloud Console.
- Create a new project.
- Navigate to the APIs & Services/Weather API.
- Enable the Weather API for your project.
- Navigate to the Google Maps Platform/Keys and Credentials.
- Create an API key and restrict it to the Weather API.
- Copy the API key and paste it into the
.envfile asWEATHER_API_KEY=your_api_key_here.
Additional information can be found at Google Weather API Documentation/Set up the Weather API.
- Navigate to the Google AI Studio/API Keys.
- Click on "Create an API key", choose your project, and create the key. If you do not see your Google Cloud project, click on "Import Project".
- Copy the API key and paste it into the
.envfile asGEMINI_API_KEY=your_api_key_here.
- Navigate to the APIs & Services/Calendar API.
- Enable the Calendar API for your project.
- Go to the Service Account Creation Page.
- Create a new service account with no permissions.
- After creating the service account, go to the "Keys" tab and add a new key in JSON format. This will download a JSON file to your computer.
- Copy the JSON file into the horizonBrief directory and rename it to
service_account.json. - Share your Google Calendar with the service account email (found in the JSON file under
client_email, or in the Service account "Details" tab) with "See all event details" permission.
- If you want to run HorizonBrief as a service, edit and copy the provided
horizonBrief.servicefile to/etc/systemd/system/horizonBrief.service. Make sure to change theExecStartandWorkingDirectorypaths to match your setup. - Enable and start the service.
sudo cp horizonBrief.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable --now horizonBrief.service