0

When you get the list of templates that are associated with a specific page (ie. http://en.wikipedia.org/w/api.php?action=query&prop=templates&format=json&tllimit=10&pageids=199445), you notice that a lot of them are not visible in the Wikpedia page itself. When I did my research, it is due to that these templates are marked as protected.

Any ideas on checking if the templates are flagged as protected?

Chux18
  • 61
  • 1
  • 1
  • 5
  • I'm not sure you understand what “protected” means. It's just that you can't edit that template, it has nothing to do with its visibility. – svick May 03 '13 at 13:42
  • Hi thanks for the response. The reason why I am asking that was I was after the data that is visible in the actual page. I'd want to disregard the ones that are pulled from the API that are not "visible" in the actual page. – Chux18 Jun 11 '13 at 02:44

1 Answers1

1

I believe there is some confusion. Some templates are protected to prevent vandalisms that could be replicated over a large quantity of pages, but it's possible to see them on wp. For example, Template:Basepage subpage can be seen in http://en.wikipedia.org/wiki/Template:Basepage_subpage . Some of them aren't shown on some articles because they can be part of another template, so they're transcluded on the article text.

Still, if you need to check if a list of pages are protected, you can use the API like this:

https://en.wikipedia.org/w/api.php?action=query&titles=Template:Basepage%20subpage|Template:Authority%20control/categories&prop=info&inprop=protection

alchimista
  • 196
  • 1
  • Cool thanks for the info! So what I was trying to achieve is getting all the templates that is linked to a wikipedia article. If you look at this API query example "http://en.wikipedia.org/w/api.php?action=query&prop=templates&format=json&tllimit=10&pageids=199445" and the actual page http://en.wikipedia.org/wiki/Wayne_Rooney, its not quite a direct match. – Chux18 Jun 11 '13 at 02:52