-2

I'm importing wiki pages based on their pageid (or url).

Lest's say I've imported a page and I've stored, among others, its language (i.e EN).

If I'm to import a translated page of the above EN version, by receiving only a new pageid (or url), how can I link between the two so I can store them in my database under the same topic id (but with 2 different languages) ?

Using the MediaWiki API of course.

dror
  • 3,759
  • 6
  • 31
  • 45

1 Answers1

0

You can check if they're connected by langlinks. For example, Einstein page result for langlinks: By title: https://en.wikipedia.org/w/api.php?action=query&titles=Albert%20Einstein&prop=langlinks By pageid: https://en.wikipedia.org/w/api.php?action=query&pageids=736&prop=langlinks But must remember that diferent language pages aren't translations, content can be different on same subject, they're not direct translations of en.wikipedia.

alchimista
  • 196
  • 1