OpenStreetMap Wiki use Gitlab static.net

Hey

For this Panoramax OSM Wiki I would like to show some statistics.
Namely this GitLab Panoramax Weblate translation this data can also be viewed at Panoramax Weblate and this GitLab Panoramax Weblate all langueges translation
OpenStreetMap wiki gives an error message if you use a link containing ‘static.net’ this is blocked by the spam filter.

Can anyone help me with how to display the Panoramax Weblate state statistics in OpenStreetMap Wiki? So that the data in the OSM wiki is automaticly updated minimum once a day.

So something like this Wikidata:Listeria - Wikidata or Data Uploads to Wikidata Thx

I am not sure i fully understand your question. You want to embed an external image in the OSM wiki? I fear this is not allowed.

Why are you using such cryptic URLs and not, e.g. https://weblate.panoramax.xyz/widget/panoramax/multi-auto.svg and https://weblate.panoramax.xyz/widget/panoramax/287x66-grey.png?

You should probably just link to a real Panoramax or Weblate webpage. The wiki does support directly hotlinking images via their raw URLs, but this is restricted to two OSM-controlled domains for security reasons. Hotlinking images is generally discouraged anyways because the user can’t get any further information about the image.

I would also refrain from directly linking to images hosted on user-content.gitlab-static.net. If it works anything like raw.githubusercontent.com, that’s just a cached copy that won’t update over time. Any update will likely result in a different URL. GitHub and GitLab mirror and cache external content to avoid hotlinking external sites directly, which poses significant security risks for those platforms.

It looks like gitlab-static.net trips up a global spam blacklist rule:

# Added by Datrio 8/4/05
\bstatic\.net

This rule was introduced in 2005 but was later tightened up to include a \b guard, matching a word boundary such as . or -, so that something like “examplestatic.net” wouldn’t trip the filter. I don’t know the context around the original addition of this rule, but replacing the \b with \. would make sense to me.

For now, I’ve reported the problem to the Wikimedia Meta-Wiki administrators, who maintain the global spam blacklist. We could also override the rule in our local whitelist if there’s a strong need to, but for now, I’d recommend just linking out to a normal webpage.

These are very different things. Basically, you’d be running a bot on a regular schedule to update the statistics on the wiki. It’s doable, and the administrators can grant your bot the necessary permission, but it seems like overkill for this particular purpose.

4 Likes

I had looked at Panoramax / Panoramax - Main documentation · GitLab and saw the image there with the Panoramax Weblate state charts. Next, I looked at the source code of the page and through web development tool, I found that cryptic URL. Hadn’t thought of looking on the Panoramax weblate page itself to see if I could find these images.

1 Like

@Strubbl How can find the page for example https://weblate.panoramax.xyz/widget/panoramax/287x66-grey.png have tried the following but fail to see the site structure via https://weblate.panoramax.xyz/sitemap.xml

grafik

→Status-Widgets Panoramax @ Weblate Panoramax

@Strubbl or @Minh_Nguyen how can I embed the file in OSM wiki? If I do this nothing is shown… [[File:https://weblate.panoramax.xyz/widget/panoramax/287x66-grey.png|thumb|Translation progress]] thx

It’s not possible:

1 Like

@Strubbl or @Minh_Nguyen And is there an work around for this, to achieve that the latest picture of the URL is shown? Can you for example use HTML code in OSM wiki like Panoramax @ Weblate Panoramax

The wiki isn’t really set up for interactive content in general. The closest thing we have is the dynamic taginfo statistics box, which is implemented as a custom JavaScript gadget that calls the taginfo API on demand. Could we take a step back and consider whether live statistics are necessary for the “Panoramax” page on the wiki?

1 Like

Just as a sidestep. The [[File:... syntax is only for images hosted on the wiki itself. If external images where allowed it would be something like http://url.for/some/image.png

2 Likes

If only for this topic then I think the answer is no. Personally I would dare to look wider and wonder at which wiki pages all this could be useful, now you can show graphs of tags in the wiki, these are also statistics. The advantage if this were possible is that the info is always up to date (not older than one day), and you could also use videos to explain something in a visual way.

The reason I ask is that the wiki’s software-related articles usually don’t go into enough detail that there would be any statistics to speak of, so I don’t really have a mental image of what this page would end up covering.

We have live statistics about tags because the stats complete the story that a tag description page tells. The page can sing its praises about a tag, but if no one ever uses it, that’ll be apparent. Conversely, a page may insist that the tag is deprecated and unpopular, but if the infobox shows a million occurrences, the reader can think more critically about the documentation.

Come to think of it, we don’t even have live statistics about the overall OSM database on the wiki. :sweat_smile:

We can introduce interactive live functionality for more content, but it’ll require active development effort. If you’re familiar with JavaScript and jQuery, you can experiment with it as a user script and let others know about it. If you want to include it as site content by default, you can then propose to turn the user script into a gadget and ask an administrator to review the code.

3 Likes

I am currently looking to see if I can implement via Wiki commons the thing I want to do, but at first glance, I can’t immediately find anything on their site that indicates this is possible.

Thanks, do you happen to know a good starting point to start from?

In the meantime, have already found the following:
Better-osm-org
Community Hub User_Scripts
wikidata osm link, GitHub wikidata osm link

User scripts are specific to MediaWiki, the software that powers the OSM Wiki, so other OSM-related tools unfortunately aren’t relevant.

To write a user script, you need to know JavaScript and ideally be familiar with the jQuery library. MediaWiki additionally provides access to these interfaces for various purposes. Wikipedia has a comprehensive guide to writing a user script. Apart from these resources, you’d need to figure out how to get a REST API – in this case, the Weblate API – to respond with the data you want to populate the page with.

If this is about a wider effort to make the wiki more dynamic, then it might be worth the development effort. However, keep in mind that the wiki is still primarily used as a bland documentation site. Some people don’t even like having to load the interactive maps, of all things, so we have an option on the preferences page to turn that gadget off.

3 Likes

Thx, found where I can get the Panoramax Weblate data