From 1076959f7163845ae6d9cf42b7f1a3aa31d002c6 Mon Sep 17 00:00:00 2001 From: Ben Kurtovic Date: Thu, 9 Jun 2016 17:10:36 -0400 Subject: [PATCH] Bugfix in highlight_delta() call; clarify docs. --- copyvios/api.py | 5 +++-- templates/api.mako | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/copyvios/api.py b/copyvios/api.py index 0be95e1..ffec124 100644 --- a/copyvios/api.py +++ b/copyvios/api.py @@ -42,8 +42,9 @@ def _serialize_source(source, show_skip=True): return data def _serialize_detail(result): - article = highlight_delta(result.article_chain, result.best.chains[1]) - source = highlight_delta(result.best.chains[0], result.best.chains[1]) + source_chain, delta = result.best.chains + article = highlight_delta(None, result.article_chain, delta) + source = highlight_delta(None, source_chain, delta) return OrderedDict((("article", article), ("source", source))) def format_api_error(code, info): diff --git a/templates/api.mako b/templates/api.mako index 7111462..0fd3268 100644 --- a/templates/api.mako +++ b/templates/api.mako @@ -228,7 +228,7 @@ ], only if action=compare and detail=true "detail": { "article": string article text, with shared passages marked with HTML, - "source": string best source text, with shared passages marked with HTML + "source": string source text, with shared passages marked with HTML } }

In the case of action=search, sources will contain one entry for each source checked (or skipped if the check ends early), sorted in order of confidence, with skipped and excluded sources at the bottom.

@@ -252,7 +252,7 @@ ] }

Etiquette

- The tool uses the same workers to handle all requests, so making concurrent API calls is only going to slow you down. Most operations are not rate-limited, but full searches with use_engine=True are globally limited to a few thousand per day. Be respectful! + The tool uses the same workers to handle all requests, so making concurrent API calls is only going to slow you down. Most operations are not rate-limited, but full searches with use_engine=True are globally limited to around a thousand per day. Be respectful!

Example

https://tools.wmflabs.org/copyvios/api.json?version=1&action=search&project=wikipedia&lang=en&title=User:EarwigBot/Copyvios/Tests/2

{