How can I get data from MediaWiki API if the title doesn't exactly match? - match

I am trying to get some information from different Wikipedia pages but in the MediaWiki result I don't get the data from the page if the title I use in my query doesn't exactly match the title of the page. Is there any way to get the best match for this title? Maybe something like the SQL LIKE operator?
Here is one example. With titles="Sankt-Jacobikirche" I don't get the page I'm looking for.
http://nl.wikipedia.org/w/api.php?action=query&prop=extracts|info&titles=Sankt-Jacobikirche&exintro=1&inprop=url
Sometimes at least I get the correct title so I can do a new request and get the correct page like with titles="Sankt-Jacobikirche_(Hamburg)"
http://nl.wikipedia.org/w/api.php?action=query&prop=extracts|info&titles=Sankt-Jacobikirche_(Hamburg)&exintro=1&inprop=url
And get the correct page with the title I get in the REDIRECT or Normalized section, like it happens with the correct title: titles="Sint-Jacobikerk (Hamburg)"
How can I get this final data starting from titles="Sankt-Jacobikirche" ?

You didn't say what you're trying to achieve, but as svick says guessing the title is an exception, not the rule.
You need to first get the correct title either by title search API or by full text search API.

Related

Sharepoint Rest Api Search query, getting a field with rich text

I am trying to get a field with a rich text but it is striping all the html in the search query. Is there a way to get the html rather than the rich text?
https://{domain}.sharepoint.com/_api/search/query?querytext=%27claim%27&selectproperties=%27Title,Question,Answer%27
<d:Key>Answer</d:Key>
<d:Value xml:space="preserve"> See THIS Form​ . ​ </d:Value>
Answer is the Rich text field with a link in it, When I do a GET (_api/web/lists/getbytitle), it comes back with a link in that field.
Basically, I want to avoid having to call search then call a GET to replace the values.
I solved this by looking through the search properties and using the ID in the path to use a GET List
_api/web/lists/getbytitle('title')/items('1')
then replacing the column in search with the rich text with the one from the GET.
I only need 3 results or so, so this was not a problem for me.
It looks like in the search query, doesnt give back any html tags for the rich text column.

Kentico: Can i get Page Title via nodeID?

I would like to display a list of a couple of my pages in a list.
Is there a macro or something else to get the page title of another site then the actual one?
All i need is a little smart function that can give me the name of a page.
Thanks for your help.
If you have the nodeID of the page you want the title of, you can use the TreeHelper static functions.
TreeNode yourNode = TreeHelper.SelectSingleNode(nodeID);
then easily enough access the name from there.
yourNode.DocumentName;
Note the difference between a TreeNode and a Document is that there are possibly multiple Document's for one TreeNode, where each is a different language/culture.

How does one get the total number of slides?

In Articulate's Storyline product, how does one retrieve the total number of slides (or pages) in a storyfile or project?
There's not much documentation so it's kind of hard to figure out how to query common environment values like this. If we can get the total number of slides then we don't have to manually set a value for it.
One must manually set and update a variable to store the number of slides.
The most lengthy conversation on the matter seems to be found here at the Articulate forums.
In that thread the users and staff describe the need to manually define such a variable.
I asked the question on the official forum more directly here, and so far have not received a response.
Another poster at that forum mentioned using PHP to solve this problem, but unfortunately we can't add the requirement of PHP to the final product. I'm sure some server side language tricks might be used to solve this issue, but that also adds the dependency of a particular server-side language.
The Answer Mark gave is correct. So if you want to track the number of question slides in a quiz you would either hard code the value in a variable such as totalQuestions, or increment it as you go through each slide using adjust variable trigger. To call that value and display it on screen you would just add it to a text field and surround it with "%".
EG. "You have answered %Results.ScorePoints% out of %totalQuestions% questions correctly."
I find it rather pointless to hard code it since it's just as easy to put the value in the text field at the end. Using the increment method seems more logical because then you can add more question slides without having to adjust the variable or results screen each time.
I usually load frame.xml, browse for all slidelink tags and sort all slides by their Id.
Usually you get something like slideid=_player.5xoxGTW6QCh.6bmeRt3tCqP, where 5xoxGTW6QCh is the scene id and 6bmeRt3tCqP is the slide id. displaytext also gives you the slide title.
If you browse for slidetranscript and match the Id for each transcript you also get the slide notes.
Articulate 360 now has an internal (Built-in) variable for this and other counts. See Project.TotalSlides and Menu.TotalSlides
See https://community.articulate.com/series/articulate-storyline-360/articles/storyline-360-add-slide-numbers

How do I get Zend_Navigation to work with database defined data?

I've got a Zend_Navigation component I use to display breadcrumbs on a page. It currently says something like:
"Companies > Edit a Company"
when displaying the edit form. I would like to make it say something like
"Companies > Editing FooBar"
What's the best way to accomplish that?
I had the problem that I wanted to show breadcrumbs even when the parent is set to not visible. Drove me nuts until I found the reason. Your problem is not much different, I think.
I have a unique ID set with basically all links; hence, I can fetch all nodes like the following:
// in view scripts
$navObject = $this->navigation()->findOneById($id);
// now you can manipulate the object however you like
$navObject->setLabel('Editing FooBar');
You can find the node by other means, there is findOneBy() method where you have to pass the target object.
Once I printed the breadcrumbs I had to reset setVisible(false) to the old value, though. Depending on your needs you might have to reset the label, too.

Selenium - verify the list of suggestions is displayed

What command is used to verify the list of suggestions is displayed when typing a letter in text field (example: a)? And how to verify the items in the list start with the letter you typed?
I believe you're talking about something like Google Suggests with autocomplete. Your test would look something like this
Load the page
Enter the value using typeAndWait to let the Ajax call happen
Compare the result to a text blob
The calls would be like this
open(/)
typeAndWait(textId,a)
verifyText(css=div#suggestion:first-child,a*)
Hope that helps