leonard-IMBERT / StarlightMap

This is an interactive map for the role play forum isle of starlight
http://hexagrid.xyz
MIT License
0 stars 2 forks source link

Retrieve map from current turn post #10

Closed KingMarth closed 6 years ago

KingMarth commented 6 years ago

I added the ability to pull the link to the current turn post from the Status post and retrieve the current map from that post instead of from the Status post. This will get us the version of the map with dots for survivor locations. I've been using that version of the map on my personal dev build for a while, I had just been manually replacing map.png.

The scrape is a little fragile, it relies on the 'turns' spoiler to be the first in the status post. If LoneStarNorth changes up formatting, this will break, though that has happened before.

leonard-IMBERT commented 6 years ago

Seems good ! I think we can improve this, i'm currently working on the crawler to be more robust. I think we can bypass the second nightmare call by looking at the naming convention lonestarnorth use for his assets (see this page http://willsaveworldforgold.com/starlight/) we'll see. I merge this but the online update will have to wait tonight (EU hours)

KingMarth commented 6 years ago

I considered that, but we also need to figure out what number the current turn is on... which, come to think of it, is handled by the first nightmare call by finding the text of the link to the current post. While that might hit a dead link, at least in that case you could register a call on the error handler to download the status post map instead, to make sure there's a valid map even if it doesn't have the dots.

KingMarth commented 6 years ago

And the very next update, the link to the next post is missing, along with any other indication in the status post of what turn it is. Defaulting to the status post map would be best, hmm.