Commit cc9d19fb authored by Caleb C. Sander's avatar Caleb C. Sander
Browse files

Add notes about special links to Wiki Game spec

parent 6094b74d
No related merge requests found
Showing with 12 additions and 0 deletions
+12 -0
......@@ -38,6 +38,18 @@ The string that comes before the next `"` character is the article being linked
The full URL of an article is `https://en.wikipedia.org/wiki/ARTICLE`; for example, the URL for the Unicode article is https://en.wikipedia.org/wiki/Unicode.
You can use Node.js's [`https.get()`](https://nodejs.org/api/https.html#https_https_get_options_callback) function to make the requests.
There are a few types of links that need special handling:
- Links to special Wikipedia pages, e.g. `href="/wiki/Template:Latin_alphabet_sidebar"`.
You can identify these links by the `:`.
They aren't real pages, so you should skip them.
- Links to sections on the same page, e.g. `href="#History"`.
You can identify these links by the `#` at the start of the link.
Again, since the link points to the same page, you don't need to follow it.
- Links to sections on other pages, e.g. `href="/wiki/Article_(grammar)#Indefinite_article"`.
You can identify these links by the `#` in the middle of the link.
To follow this link, remove the part starting with `#`.
In this example, that would be `/wiki/Article_(grammar)`.
## Implementing the Wikipedia search
The general idea is to start at the source article, follow each link to another Wikipedia article, and stop upon reaching the target article.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment