diff --git a/README.md b/README.md index 010cd72..cc54a80 100644 --- a/README.md +++ b/README.md @@ -1,21 +1,21 @@ This is a [copyright violation](https://en.wikipedia.org/wiki/WP:COPYVIO) -detector running on [Wikimedia Labs](https://tools.wmflabs.org/copyvios). +detector running on [Wikimedia Cloud Services](https://copyvios.toolforge.org/). It can search the web for content similar to a given article, and graphically compare an article to a specific URL. Some technical details are expanded upon -[in a blog post](http://benkurtovic.com/2014/08/20/copyvio-detector.html). +[in a blog post](https://benkurtovic.com/2014/08/20/copyvio-detector.html). Dependencies ============ * [earwigbot](https://github.com/earwig/earwigbot) >= 0.1 -* [flask](http://flask.pocoo.org/) >= 0.10.1 +* [flask](https://flask.palletsprojects.com/) >= 0.10.1 * [flask-mako](https://pythonhosted.org/Flask-Mako/) >= 0.3 -* [mako](http://www.makotemplates.org/) >= 0.7.2 +* [mako](https://www.makotemplates.org/) >= 0.7.2 * [mwparserfromhell](https://github.com/earwig/mwparserfromhell) >= 0.3 -* [oursql](http://packages.python.org/oursql/) >= 0.9.3.1 -* [requests](http://python-requests.org/) >= 2.9.1 -* [SQLAlchemy](http://sqlalchemy.org/) >= 0.9.6 +* [oursql](https://pythonhosted.org/oursql/) >= 0.9.3.1 +* [requests](https://requests.readthedocs.io/) >= 2.9.1 +* [SQLAlchemy](https://www.sqlalchemy.org/) >= 0.9.6 * [apsw](https://github.com/rogerbinns/apsw) >= 3.26.0 * [uglifycss](https://github.com/fmarcia/UglifyCSS/) * [uglifyjs](https://github.com/mishoo/UglifyJS/) >= 1.3.3 @@ -25,7 +25,7 @@ Running - If using Tool Labs, you should clone the repository to `~/www/python/src`, or otherwise symlink it to that directory. A - [virtualenv](http://virtualenv.readthedocs.org/) should be created at + [virtualenv](https://virtualenv.pypa.io/) should be created at `~/www/python/venv`. - Install all dependencies listed above. diff --git a/app.py b/app.py index 14889d3..ff88f48 100755 --- a/app.py +++ b/app.py @@ -58,7 +58,7 @@ def setup_app(): def prepare_request(): g._db = None g.cookies = parse_cookies( - request.script_root, request.environ.get("HTTP_COOKIE")) + request.script_root or "/", request.environ.get("HTTP_COOKIE")) g.new_cookies = [] @app.after_request diff --git a/copyvios/turnitin.py b/copyvios/turnitin.py index 2b436ad..a6177e9 100644 --- a/copyvios/turnitin.py +++ b/copyvios/turnitin.py @@ -8,7 +8,7 @@ from .misc import parse_wiki_timestamp __all__ = ['search_turnitin', 'TURNITIN_API_ENDPOINT'] -TURNITIN_API_ENDPOINT = 'http://tools.wmflabs.org/eranbot/plagiabot/api.py' +TURNITIN_API_ENDPOINT = 'https://eranbot.toolforge.org/plagiabot/api.py' def search_turnitin(page_title, lang): """ Search the Plagiabot database for Turnitin reports for a page. diff --git a/static/toolinfo.json b/static/toolinfo.json index 03c18c8..3990634 100644 --- a/static/toolinfo.json +++ b/static/toolinfo.json @@ -2,7 +2,7 @@ "name" : "copyvios", "title" : "Copyvios", "description" : "Detects copyright violations in pages by searching for their contents online. Can also compare a page and a specific URL.", - "url" : "https://tools.wmflabs.org/copyvios", + "url" : "https://copyvios.toolforge.org/", "keywords" : "copyvios, copyright violations", "author" : "The Earwig", "repository" : "https://github.com/earwig/copyvios" diff --git a/templates/api.mako b/templates/api.mako index 0fd3268..18913b2 100644 --- a/templates/api.mako +++ b/templates/api.mako @@ -40,9 +40,9 @@ % if help:

Copyvio Detector API

-

This is the first version of the API for Earwig's Copyvio Detector. It works, but some bugs might still need to be ironed out, so please report any if you see them.

+

This is the first version of the API for Earwig's Copyvio Detector. It works, but some bugs might still need to be ironed out, so please report any if you see them.

Requests

-

The API responds to GET requests made to https://tools.wmflabs.org/copyvios/api.json. Parameters are described in the tables below:

+

The API responds to GET requests made to https://copyvios.toolforge.org/api.json. Parameters are described in the tables below:

@@ -63,7 +63,7 @@ - + @@ -254,7 +254,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 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

+

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

{
     "status": "ok",
     "meta": {
diff --git a/templates/index.mako b/templates/index.mako
index b676a6d..1d4a1ac 100644
--- a/templates/index.mako
+++ b/templates/index.mako
@@ -35,11 +35,11 @@
         

% elif not query.site:
-

The given site (project=${query.project | h}, language=${query.lang | h}) doesn't seem to exist. It may also be closed or private. Confirm its URL.

+

The given site (project=${query.project | h}, language=${query.lang | h}) doesn't seem to exist. It may also be closed or private. Confirm its URL.

% elif query.oldid and not result:
-

The given revision ID doesn't seem to exist: ${query.oldid | h}.

+

The given revision ID doesn't seem to exist: ${query.oldid | h}.

% elif query.title and not result:
@@ -47,10 +47,10 @@
% endif %endif -

This tool attempts to detect copyright violations in articles. In search mode, it will check for similar content elsewhere on the web using Google, external links present in the text of the page, or Turnitin (provided by EranBot), depending on which options are selected. In comparison mode, the tool will compare the article to a specific webpage without making additional searches, like the Duplication Detector.

+

This tool attempts to detect copyright violations in articles. In search mode, it will check for similar content elsewhere on the web using Google, external links present in the text of the page, or Turnitin (provided by EranBot), depending on which options are selected. In comparison mode, the tool will compare the article to a specific webpage without making additional searches, like the Duplication Detector.

Running a full check can take up to a minute if other websites are slow or if the tool is under heavy use. Please be patient. If you get a timeout, wait a moment and refresh the page.

-

Be aware that other websites can copy from Wikipedia, so check the results carefully, especially for older or well-developed articles. Specific websites can be skipped by being added to the excluded URL list.

-
+

Be aware that other websites can copy from Wikipedia, so check the results carefully, especially for older or well-developed articles. Specific websites can be skipped by being added to the excluded URL list.

+
Alwaysformat json, jsonfm No (default: json)The default output format is JSON. jsonfm mode produces the same output, but renders it as a formatted HTML document for debugging.The default output format is JSON. jsonfm mode produces the same output, but renders it as a formatted HTML document for debugging.
version
@@ -165,7 +165,7 @@ % else: seconds. % endif - Permalink. + Permalink.
@@ -179,11 +179,11 @@
Site: ${query.page.title | h} % if query.oldid: - @${query.oldid | h} + @${query.oldid | h} % endif % if query.redirected_from:
- Redirected from ${query.redirected_from.title | h}. Check original. + Redirected from ${query.redirected_from.title | h}. Check original. % endif
@@ -225,7 +225,7 @@ % if query.turnitin_result.reports: % for report in turnitin_result.reports: - % endfor diff --git a/templates/settings.mako b/templates/settings.mako index 64b308f..8787812 100644 --- a/templates/settings.mako +++ b/templates/settings.mako @@ -42,7 +42,7 @@ <% background_options = [ - ("list", 'Randomly select from a subset of previous Wikimedia CommonsPictures of the Day that work well as widescreen backgrounds, refreshed daily (default).'), + ("list", 'Randomly select from a subset of previous Wikimedia CommonsPictures of the Day that work well as widescreen backgrounds, refreshed daily (default).'), ("potd", 'Use the current Commons Picture of the Day, unfiltered. Certain POTDs may be unsuitable as backgrounds due to their aspect ratio or subject matter.'), ("plain", "Use a plain background."), ] diff --git a/templates/support/footer.mako b/templates/support/footer.mako index 814f0be..9c0ba0d 100644 --- a/templates/support/footer.mako +++ b/templates/support/footer.mako @@ -4,13 +4,13 @@ %>\ diff --git a/templates/support/header.mako b/templates/support/header.mako index 1a7e92e..e92829f 100644 --- a/templates/support/header.mako +++ b/templates/support/header.mako @@ -21,7 +21,7 @@
Report ${report.reportid} for text added at ${report.time_posted.strftime("%H:%M, %d %B %Y (UTC)")}: +
Report ${report.reportid} for text added at ${report.time_posted.strftime("%H:%M, %d %B %Y (UTC)")}:
    % for source in report.sources:
  • ${source['percent']}% of revision text (${source['words']} words) found at ${source['url'] | h}
  • @@ -269,7 +269,7 @@ % endif
- Compare + Compare
- +
Earwig's Copyvio DetectorEarwig's Copyvio Detector Settings