Week: 15
MapSimple Location 4.0.6 for WordPress Released
- HERE Maps is joined by using HERE as a Weather and a Reverse Geocoding provider. While doing this, I discovered they switched to an API key system, and updated the code appropriately. HERE Maps also has a new endpoint, so I switched to that as well.
- I went through the API documentation for all of the existing weather endpoints and made some changes to standardize the units of measurement being stored. Did you know a millbar and a hectopascal are essentially the same thing?
- I added support for the Met Office, which offers several hundred stations in the UK. Like the US National Weather Service, it provides the closest one, and if there isn’t close, it returns nothing. Working on another station-based weather provider interested me in trying to add better support for personal weather stations.
- If you have WP_DEBUG enabled, a new tab appears on the Location Settings page to allow you to see what data is returned by your provider. This is used mostly by me as the developer, but I’ve kept it in in case someone wants to troubleshoot the information they are getting.
Thinking About Weather
However, this is not the first time an API has shut down on me. I created a WordPress plugin called Simple Location. It uses map APIs to show maps of location, reverse geocoding APIs to turn coordinates into location data, and of course, Weather APIs to get the weather for a location at the time of a post.
I like adding weather to my posts, and I maintain my own weather stations at two locations. So, I went through all of the Weather API I have integrated to note some of the pros and cons.
- HERE – The newest provider I’ve added. It returns some info none of the other providers do: Descriptor values for air, sky; a textual description of the air, temperature, and precipitation; Snow cover as well as amount that has fallen; wind speed on the Beaufort scale; UV index; Barometric trend And their free tier offers 250,000 transactions per month. Does not offer historical data.
- National Weather Service – No API key or limits as government data. Doesn’t keep more than a few days of historic data. Good general data. You are also limited to NWS Observation and forecast stations.
- OpenWeatherMap – The free tier limits you to 1000 calls per day, and a limited subset of their APIs. However, in response to the Dark Sky situation, they just added a new API endpoint that is included, which mirrors the Dark Sky API offering. It offers the current weather, hourly forecast for 48 hours, daily forecast for 7 days, and historical weather data for 5 previous days. It also offers a Stations API for retrieving data from a user supplied weather station. UV Index is available, but that is a separate API call. They’ll also sell you 40 years worth of weather data for a single location for 10 cents.
- Weatherbit – Daily forecasts and current weather data is free for non-commercial use. Offers UV Index and Air Quality Index. Allows for historical data.
- WeatherStack – Free tier limits you to 1000 calls per month, so this is the one I’m least likely to use. Does include historical data.
- Met Office UK – The UK’s service has the most basic of all the data provided. Behind a free API key, you can get information for several hundred stations in the UK. However, the Data Point API is set to be replaced in future, but the replacement does not currently have an observation API, only a forecast one.
- Accuweather – Free tier limited to 50 calls per day, and referred to as a trial. And you cannot lookup by location, you need to query for a location key…which means if you look it up every time, that’s only 25 calls per day. Didn’t even bother to implement this.
- Weather Channel – only opened its API for a Call for Code challenge period.
- Weather Underground – While Weather Underground shut its API down, it does still offer one for Personal Weather Station contributors. This appeals to me. I still send my weather data to Weather Underground…as well as 5 other places. But I would only be able to search current conditions for Personal Weather Stations.
- AerisWeather – Same as Weather Underground, free access to their APIs and weather reporting stations if you contribute. Might implement this in future.
Anyone have any other weather sources for current conditions?
IndieWebCamp Berlin is an all-levels BarCamp-like collaboration in Berlin for two days of keynotes, brainstorming, creating, teaching, and helping gain more control over our data and lives online!
The ninth annual gathering for independent web creators of all kinds, graphic artists, designers, UX engineers, coders, hackers, to share ideas, create and improve their personal websites, and build upon each others creations.
Simple Location 3.7.0 Released
Going forward, Micropub posts with a location property will be set to public by default unless the client sends information indicating otherwise.
To support fixing the ones set incorrectly, there is now a bulk action to set multiple posts to private or public.
For Micropub posts without a location property, there is now a setting to add one from the backend geolocation provider. This will obviously not work with the web browser based provider, only the ones that work in the background. There are currently 2 bundled in.
- Set Location from Author Profile – This will always pull the location set in the user’s metadata. You can read about how to set this here. Thereotically, any external provider that supports HTTP requests could use this
- Compass – Aaron Parecki’s location storage system. I selfhost my own copy.
In a future update, will be looking to set Compass API lookup per user so each user could have a separate feed for location.
IndiewebPress: Users
In the Indieweb world, your domain is your identity. This would suggest that most WordPress sites should only have one user…representing the identity of the site. Users, however, represent roles and responsibilities within the system, not necessarily content creators.
In an update to the ‘official’ Indieweb plugin, I, with some encouragement, added the idea of designating a specific user as the ‘identity’ of the site…assuming there was one. But let’s expand that idea a bit. We have user metadata, we have the ability to define new roles and capabilities. So, what can we do with this but create new possibilities? We can better work what a role is, and add additional properties and behavior to improve the system.
There is a setting for an admin email, for which the suggestion to expand outward has been proposed for 8 years in this vein. This should be a property of any administrative account.
I have an idea I’ve long wanted to implement. It is based on a feature used by Postmatic. People who subscribed to the email service they provided would end up as users on your site. I’d like to see enhancements to the user profile. When trying to add other site profiles to user metadata, I discovered that this being left to the plugins has resulted in a complete lack of consistency.
There needs to be a consistent structure to add data to support URLs on specific other types of sites( for example, Twitter), or every plugin is going to have to retread this. This is the trouble we have with all metadata unfortunately.
That idea of using the user table for outside visitors has a lot of good potential. Commenters could create a profile on your site that could be imported from elsewhere…namely your own website. There is a certain level of trust there, because you would be displaying images and text about a person from another site…however, that is what gravatar does. Why not allow people to do it from their own site?
Gravatar itself is something that WordPress wouldn’t have put in today….a reliance on an outside service. The local avatar trac ticket is also a rather old request. It is time to look at avatars in general…to build a robust local system that is enhanced by gravatar…gravatar should not be that system. We can add in modern themeable profiles for users, as opposed to just archive pages. We can make a much better system for users.
The whole point of the ‘subscriber’ role in WordPress is for people not part of the blog to have an account they can do something with…follow the site, get updates, participate in comments…but this part of WordPress is woefully underused.