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

make deep links shorter #159

Closed
ralfhauser opened this issue Apr 1, 2019 · 21 comments
Closed

make deep links shorter #159

ralfhauser opened this issue Apr 1, 2019 · 21 comments
Assignees
Labels
4 - In Review ready to submit a PR for review. Feature Request For new features
Milestone

Comments

@ralfhauser
Copy link
Member

The URL gets split on 2 pages

image

@ralfhauser
Copy link
Member Author

ralfhauser commented Apr 1, 2019

  1. we should offer on the detail view a button that automatically copies it into the clipboard
  2. https://beta.water-fountains.org/zurich?lang=de&queryType=byId&database=wiki
    data&idval=Q55170432 might be shortened to

https://water-fountains.org/zh?l=d&qt=id&db=wikidata&id=Q55170432
https://water-fountains.org/zh?l=d&qt=id&db=wd&i=Q55170432

a) eventually, we might do another try for a shorter domain URL again

@mmmatthew
Copy link
Member

mmmatthew commented Apr 12, 2019

  1. as discussed, we could also use the id to determine the database.

@mmmatthew mmmatthew added 0 - Backlog issues that await planning and implementation Feature Request For new features labels Apr 12, 2019
@ralfhauser
Copy link
Member Author

ralfhauser commented Apr 12, 2019

Re 3) as all wikidate id's start with "Q" and no OSM does, please implement this as a quick-win (and make the "database" parameter optional for now as we currently only have 2 possible databases)

So we probably could get to
3a) https://water-fountains.org/zh?l=d&i=Q55170432
which is quite unlikely to be hyphenated

@mmmatthew mmmatthew added 2 - Ready Ready to implement and removed 0 - Backlog issues that await planning and implementation labels Apr 12, 2019
@mmmatthew mmmatthew added this to the quickfix milestone Apr 12, 2019
@mmmatthew
Copy link
Member

mmmatthew commented Apr 12, 2019

Is it too long to spell out zurich and lang?

3b) https://beta.water-fountains.org/zurich?lang=de&idval=Q55170432

this 58 chars, and the maximum allowable before getting split (according to first image) is 76 chars, so we still have room for long location names.

@ralfhauser
Copy link
Member Author

ralfhauser commented Apr 13, 2019

Is it too long to spell out zurich and lang?

No, it is not.

But if we touch it, I would allow for the shorter variant in parallel


and what is the rationale to make it as long as "idval" and not just "id" or even "i" ?

@mmmatthew
Copy link
Member

I am unhappy with "idval" but "id" seemed to be used internally as it caused the app to crash when I would use it.

@ralfhauser
Copy link
Member Author

then pls go vor "i" that is even shorter

@ralfhauser
Copy link
Member Author

  1. as for the city-Kürzel:
    a) a for pioneers, we can stay with just 2 letters like "ZH".
    b) for internationalization, I suggest to take b1) the ISO 2-Letter-Country id and then b2) a country-internal 2-char identifier

==> "CH-ZH"

Re b2) that should be semantically taken out of wikidata

@mmmatthew mmmatthew self-assigned this May 28, 2019
mmmatthew added a commit to water-fountains/datablue that referenced this issue May 28, 2019
mmmatthew added a commit that referenced this issue May 28, 2019
@mmmatthew mmmatthew added 4 - In Review ready to submit a PR for review. and removed 2 - Ready Ready to implement labels May 28, 2019
@mmmatthew
Copy link
Member

Here is the new format:

https://beta.water-fountains.org/ch-zh?l=de&i=Q55169550

@mmmatthew
Copy link
Member

The old urls should still be compatible.

@ralfhauser
Copy link
Member Author

ralfhauser commented May 29, 2019

The language in https://beta.water-fountains.org/us-nyc?l=en does not work :(

  1. could the key languages also be single-letter ? d/f/i/e ?
    so, we would get to https://beta.water-fountains.org/us-ny?l=e

@ralfhauser
Copy link
Member Author

The URLs in 2 and 3 don't work.

Is 4b2 implemented ?

@mmmatthew
Copy link
Member

mmmatthew commented Jun 14, 2019

I only implemented the shortest variant, not the intermediate ideas. That is why I didn't implement the variants 2 and 3 b

3a works when you include the beta before.

4b2 is a new issue

@ralfhauser
Copy link
Member Author

ralfhauser commented Jun 14, 2019

3a works when you include the beta before.

Will it work without "beta" once you released production ?

@mmmatthew
Copy link
Member

I don't see why not.

@ralfhauser
Copy link
Member Author

I don't see why not.

Then, let's verify and close this once we are there

@mmmatthew
Copy link
Member

Then, let's verify and close this once we are there

https://water-fountains.org/zh?l=d&i=Q55170432 works

@ralfhauser
Copy link
Member Author

Thanks - the original idea of #35 or rather #244 is still pending ?

@mmmatthew
Copy link
Member

#244 is still pending. Fountains are aggregated and stored on a city-by-city basis, so if only an identifier is provided, an extra step is required before fetching the data, to search city databases for specific fountain. In the long term, it makes sense to upgrade how the aggregated fountains are stored and use a database instead of the current simple cache solution.

@ralfhauser
Copy link
Member Author

I guess the "extra step" would be to create on the bi-hourly region-reload an index of all Q-Ids-vs. City.

But since we have < 10'000 fountains covered, such an index should be quick to be built in no time and querying it should be even quicker

@ralfhauser
Copy link
Member Author

see also water-fountains/import2wikidata#10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4 - In Review ready to submit a PR for review. Feature Request For new features
Projects
None yet
Development

No branches or pull requests

2 participants