Retrieves a list of popular pages.
| Name | Type | Description |
| offset | int? | Number of items to skip. Must be a positive number or 0 to not skip any. (default: 0) |
| limit | string? | Maximum number of items to retrieve. Must be a positive number or 'all' to retrieve all items. (default: 50) |
| authenticate | bool? | Force authentication for request (default: false) |
| Name | Value | Description |
| OK | 200 | The request completed successfully |
Output:
<pages.popular count="{int}" href="{uri}">
<page id="{int}" href="{uri}">
<title>{text}</title>
<path>{text}</path>
<metrics>
<metric.views>{int}</metric.views>
</metrics>
</page>
...
</pages.popular>
Redirect and archived pages are not included in the output.
"Metric views" in the output means page views.
The following code example retrieves the popular pages:
Plug p = Plug.New("http://deki-hayes/@api/deki");
p.At("users", "authenticate").WithCredentials("admin", "password").Get();
p.At("pages", "popular").Get();
Sample response indicating that there are two popular pages:
<pages.popular count="2" href="http://deki-hayes/@api/deki/pages/popular">
<page id="29" href="http://deki-hayes/@api/deki/pages/29">
<title>DekiWiki (Hayes)</title>
<path />
<metrics>
<metric.views>23</metric.views>
</metrics>
</page>
<page id="31" href="http://deki-hayes/@api/deki/pages/31">
<title>Page Title</title>
<path>Page_Title</path>
<metrics>
<metric.views>5</metric.views>
</metrics>
</page>
</pages.popular>
The following command retrieves a list of the most popular pages on the site:
curl -u username:password -i http://mindtouch.address/@api/deki/pages/popular
Sample response of the top 3 most popular pages on a site. Append "?limit=3" to end of command:
Content-Type: application/xml
<pages.popular count="3" href="http://192.168.59.128/@api/deki/pages/popular">
<page id="21" href="http://192.168.59.128/@api/deki/pages/21?redirects=0">
<uri.ui>http://192.168.59.128/</uri.ui>
<title>Best Wiki Ever</title>
<path/>
<namespace>main</namespace>
<metrics>
<metric.views>380</metric.views>
</metrics>
</page>
<page id="567" href="http://192.168.59.128/@api/deki/pages/567?redirects=0">
<uri.ui>http://192.168.59.128/FUBAR</uri.ui>
<title>FUBAR</title>
<path>FUBAR</path>
<namespace>main</namespace>
<metrics>
<metric.views>83</metric.views>
</metrics>
</page>
<page id="565" href="http://192.168.59.128/@api/deki/pages/565?redirects=0">
<uri.ui>http://192.168.59.128/Bar</uri.ui>
<title>Bar</title>
<path>Bar</path>
<namespace>main</namespace>
<metrics>
<metric.views>76</metric.views>
</metrics>
</page>
</pages.popular>