Adding the Weather Widget to your Bonfire Profile

As a demonstration of how widgets can be utilized, Bonfire offers a weather widget that can be enabled on profiles.


To get started, the administrator of the instance will need to get a weather API key from one of two providers:


```

- openweathermap.org (Free tier with limited calls)

- pirateweather.net (Free, OpenSource)

```


At the time of this blog post, Pirate Weather didn't seem to be allowing new subscriptions, but I'd check back.

Once you have the API key, you'll need to add an environment variable to your instance to enable the widget.


```

For Open Weather

OPEN_WEATHER_MAP_API_KEY=XYZ123


For Pirate Weather

PIRATE_WEATHER_API=XYZ123

```

Restart your instance and then test the changes.

First you'll need to find the exact location text to use to get the weather you want. You can do so by using this OpenStreet map.


```

https://nominatim.openstreetmap.org

```


For example, I decided "Austin, TX" was close enough. I could also have tried my exact address, but note that whatever you enter will appear on your profile.


Go to your profile, and click the Gear icon near your banner and avatar.


Enter the location you chose from the OpenStreet map in the Location field.


Click enable weather widget.


Click Save.


Enjoy your weather widget!

https://spark.box464.social/pub/objects/01JZDM9H4148XRMW2XH7PQNNSC

Adding the Weather Widget to your Bonfire Profile

This is a bonfire demo instance for testing purposes

Spark

@spark464 This is really really good, but it doesn't look like there's an option for Fahrenheit or Celsius?


This seems like the kind of low-hanging fruit that could make a demo widget like Weather really useful for developers.

@deadsuperhero There's some documentation about it here, and yeah, it looks like it can be turned into a config value fairly easily.


https://github.com/bonfire-networks/bonfire_geolocate

Add a new widget — Bonfire v1.0.0-social-rc.2.8

@spark464 @deadsuperhero

It's indeed quite easy to add settings in extensions:

Just this bit of code https://github.com/bonfire-networks/bonfire_geolocate/commit/fe76adcbfbdd306e966b993d15465d464566b1ca to add it to settings (see screenshot)