Simple Location adds a section to your WordPress user profile called Last Reported Location. It allows you to set the last reported location for a given user. It reports latitude, longitude, altitude, and whether or not the location is public, private, or protected.
In the Simple Location Settings, you can set this to update each time you publish a post if the location isn’t set as private. So it would reflect the last post you made.
This feature can be used in one of two ways. You can add the Last Seen Widget to your page and display the last place you were seen. Alte
rnatively, this can work in reverse. You can set it so your posts will set post location from the last seen location of the author.
But, what use is that if the only way a to update the Last Seen setting is to set it from a post(creating an endless loop) or to set it manually? If you always want to always set a default location, this can be an option.
However, that doesn’t work for me. So, I built a way to update your location from an outside service.
First, you need an IndieAuth token. If you installed the IndieAuth plugin, you can get one manually under Users->Manage Token.
curl -i -H 'Authorization: Bearer FAKETOKEN' -d "latitude=30&longitude=-115&visibility=public" "https://www.example.com/wp-json/sloc_geo/1.0/user"
Here is an example of updating your location via a curl command line command. It figures out which user based on the user of the token you created.
The parameters currently used are latitude, longitude, altitude(will be automatically derived if not present), and visibility(public, private, protected).
If you are successful, it will return ‘Updated’ and automatically lookup the name of the location you are at.
So, what can you do with this feature? Keeping in mind the day, though I call today Tuesday…Let’s say hypothetically you are in the package delivery business and you want to share your location with the people who are eagerly awaiting your deliveries. You could use this to send your location from your phone to your website to keep the display updated.
Alternatively, if you don’t trust the browser on your computer to know where you are, you could rig up a shortcut on your phone to update the location so it would be accurate if you post, for example on Android with Tasker.
There is more that is needed to enhance this feature. On my list for future is Geofencing…the idea of zones inside which the location would either be set to private or display a generic ‘Home’ or ‘Work’ etc. I already have the code to calculate this, but haven’t figured out how the UI would look. This would allow much more granular controls than the global privacy default.
Read Using the Last Seen Function in Simple Location by David Shanske (david.shanske.com)
The Simple Location plugin for WordPress has some awesome power built into it. David does a great job here of explaining some of it’s additional behind-the-scenes power.
Syndicated copies to:
Also on:
Simple Location Version 3.7.0 was released. This version fixes an issue where Micropub post locations were not showing because they were defaulting to private.
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.