Closed nogarcia closed 5 years ago
This is what I get for blindly copy and pasting from StackOverflow. The docs for OpenSearch give the parameters plain and simple. Adding &redirects=resolve
will return pages after the redirect.
[
"The Incredible Hulk",
[
"The Incredible Hulk",
...snip
],
[
"",
"The Incredible Hulk is a 2008 American superhero film based on the Marvel Comics character the Hulk, produced by Marvel Studios and distributed by Universal Pictures.",
...snip
],
[
"https://en.wikipedia.org/wiki/The_Incredible_Hulk",
...snip
]
]
The first URL redirects to Hulk, but the actual response we get is #REDIRECT[[Hulk]]
.
[
"The Incredible Hulk",
[
"Hulk",
...snip
],
[
"The Hulk is a fictional superhero appearing in publications by the American publisher Marvel Comics. Created by writer Stan Lee and artist Jack Kirby, the character first appeared in the debut issue of The Incredible Hulk (May 1962).",
...snip
],
[
"https://en.wikipedia.org/wiki/Hulk",
...snip
]
]
The lesson is to always read the documentation.
That code is a mess and crazily inefficient. It also breaks on a page REDIRECT and doesn't do well with disambiguation pages. I need to find a way to give some sort of checklist with that page.