Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove date from download script #1

Open
tokei opened this issue Oct 25, 2011 · 1 comment
Open

Remove date from download script #1

tokei opened this issue Oct 25, 2011 · 1 comment

Comments

@tokei
Copy link
Member

tokei commented Oct 25, 2011

The old script used to parse a date from the downloaded XML. In the new API, this date no longer exists so for now we replaced it with a static string. But it looks like the date is not used in the rest of the script anyhow so it should be removed all together. But first we should find out what was the intention behind this.

@tanjeff
Copy link
Member

tanjeff commented Oct 25, 2011

The date is shown on the Mateka'te when the '+' sign in the upper right corner is "opened". It specifies the time at which the last update was fetched from the OSM server. Here is how it works.

Consider the file machMateKate.rb (version 650083c):

  • Line 193 (in parse()): The variable date is set.
  • Line 196: (in parse()): date is being returned (together with count).
  • Lines 211 and 226: parse() is called, once for the club-mate points and once for the afri-cola points. The received dates are stored in the global variables $date_drink_club_mate and $date_drink_afri_cola respectively.
  • Lines 249 - 267: The HTML code is generated by copying the contents from infile to outfile line by line. During this process, the $date_drink_club_mate and $date_drink_afri_cola values are inserted (only if the respective patterns are found in infile, of course).

The update date was originally read from the OSM files (which contain XML data). This has advantages when the download of new data fails for some reason - the old script simply used the older files which were still there. In this case, the date in each file indicated how old the respective data was.

If the date is not longer part of these files, it should be removed. It would be useless to know when the script ran the last time. Only the real age of the OSM data is of interest.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants