edsu / anon

tweet about anonymous Wikipedia edits from particular IP address ranges
Creative Commons Zero v1.0 Universal
975 stars 152 forks source link

Enhancment: @metadata in ranges.json #115

Closed lokal-profil closed 9 years ago

lokal-profil commented 10 years ago

For a completely externalised ranges.json file it might be nice to add an "@metadata" object containing information such as source of ranges, last date they were verified etc.

I'm currently unsure how adding a field like this would be handled by the app since I can't figure out how it deals with incorrectly formatted range objects. If it does throw a wrench in the works would it be possible to make it skip name=@metadata (or some similar convention)?

edsu commented 10 years ago

Can you sketch out what this metadata might look like with an example or two?

lokal-profil commented 10 years ago

E.g. Creeper.json

lokal-profil commented 10 years ago

I've used something like "@metadata": { "source": "URL", "fetch date":"DATE" } but I can imagine many different fields which could be added in order to credit sources or increase transparency.

lokal-profil commented 10 years ago

So my solution was simply to add the above to the top of my range files and then add: delete account.ranges['@metadata'] as a new line after line 53 in anon.coffee to prevent the metadata from affecting the running of the program.

edsu commented 10 years ago

Why not let the metadata live in a revision control system like git?

lokal-profil commented 10 years ago

People curious about which ranges are being used will often just look at the json file. If metadata is available there (I'm mainly thinking source etc.) then it is easy to spot where it is from and even easier to reuse the ranges.

The reason for adding the "last update"-date in the file is similarly that it makes it easier for others to highlight if the file is out of date/there has been an update in the original source.

I removed this from the patch in order not to block the other fixes.

edsu commented 9 years ago

I'm sorry I just haven't needed this functionality.