This extension has not been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues.
This plugin allows to embed results from the YQL (Yahoo! Query Language) API of Yahoo! in a wiki page. The plugin only works for certain queries and certain query fields and has mainly been created because I needed to embed a certain query result. The plugin does not support queries that need authorization or return one single result (and not a list of results). It is recommended that you try out your query in the YQL Console in order to find the necessary parameters for the plugin. To learn if accessing a table requires authentication, execute SHOW TABLES and note that tables with security=ANY do not require YQL Authentication, whereas the others do.
The results of the query are displayed as list, the individual list items can be formatted using a simple format string and support text items and links.
A simple query to combine two RSS feeds:
<YQL> select title,link,pubDate from rss where url in ( 'http://feeds.feedburner.com/dokuwiki', 'http://feeds.feedburner.com/PlanetDokuwiki' ) | sort(field='pubDate',descending='true')|truncate(count=10) </YQL>
And another query, displaying a list of Sushi restaurants in San Francisco using a custom display format:
<YQL format="%%Url|Title%% in %%MapUrl|Address%% (phone: %%Phone%%)" item_name="Result" refresh="28800"> select * from local.search where query="sushi" and location="san francisco, ca" </YQL>
Here a screenshot of the output of the two examples:
The basic syntax is:
<YQL> your_query </YQL>
where your_query is the query you want to execute. Within the <YQL>-tag further options can be specified in the form option=“value”:
- format: The format is a combination of a simple string combined with the names of the result values that shall be displayed enclosed in “%%” as in the example. As in normal DokuWiki links you can create a link by separating the name of the url field and the title field by “|”.
- item_name: Inside the results, the actual results items are in many cases inside a special field. The default is “item” which is also the output from the rss “table”, but in other cases it can also be “Result” as shown in the example or “event” for events.
- refresh: The time for which the page should be cached in seconds, the default is as for rss feeds 4 hours (14400 seconds).
There are many features that are currently missing, but everything I currently need works so most probably I won't put too much work into improving it. But if you have a special use case feel free to submit feature requests, bug reports or submit even patches or pull requests on GitHub.
- Fix method signature compatibility for PHP 7.0 (2016-01-16 22:20)
- Minor return value and comment correction (2013-09-17 22:58)
- Fix a typo that prevented the refresh parameter from working (2013-09-17 22:53)
- Re-rename the format parameter to mode (2013-09-17 22:31)
- Code cleanup: Remove superfluous "extract" (2013-09-17 22:22)
- Make the return type of the render function consistent (2013-09-17 22:10)
- More type information and comments (2013-09-17 22:10)
- New version 2013-09-17 (2013-09-17 22:10)
Known Bugs and Issues
The plugin currently only supports certain YQL results and doesn't output any information when an error occurs.
Please don't report any bugs or feature wishes here but use the issue tracker at GitHub.